Skip failing test if platform.dist() is Xenial by cclauss · Pull Request #831 · gitpython-developers/GitPython
Okay, this is pretty frustrating. The entire test suite seems to run only if the current branch is "master". If you are on another branch, there are a number of failures due to bad assumptions? Does anybody else do their work on a branch in a fork, or do you do all of your work in the master branch of your fork?
Example:
======================================================================
FAIL: test_init_repo_object (git.test.test_docs.Tutorials)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/home/jking/GitPython/git/test/lib/helper.py", line 92, in wrapper
return func(self, path)
File "/home/jking/GitPython/git/test/test_docs.py", line 75, in test_init_repo_object
"It's ok if TC not running from `master`.")
AssertionError: <git.Head "refs/heads/fix-requirements"> != <git.Head "refs/heads/master"> : It's ok if TC not running from `master`.
-------------------- >> begin captured logging << --------------------
git.cmd: DEBUG: Popen(['git', 'init', '--bare'], cwd=/tmp/test_init_repo_objectm8st37bo/bare-repo, universal_newlines=False, shell=None)
git.cmd: DEBUG: Popen(['git', 'status', '--porcelain', '--untracked-files'], cwd=/home/jking/GitPython, universal_newlines=False, shell=None)
git.cmd: DEBUG: Popen(['git', 'clone', '-v', '/home/jking/GitPython/.git', '/tmp/test_init_repo_objectm8st37bo/to/this/path'], cwd=/home/jking/GitPython, universal_newlines=True, shell=None)
git.repo.base: DEBUG: Cmd(['git', 'clone', '-v', '/home/jking/GitPython/.git', '/tmp/test_init_repo_objectm8st37bo/to/this/path'])'s unused stdout:
git.cmd: DEBUG: Popen(['git', 'init'], cwd=/tmp/test_init_repo_objectm8st37bo/path/for/new/repo, universal_newlines=False, shell=None)
git.cmd: DEBUG: Popen(['git', 'cat-file', '--batch-check'], cwd=/home/jking/GitPython, universal_newlines=False, shell=None)
git.cmd: DEBUG: Popen(['git', 'archive', '2e414deff98915b736639a67cc1dbf79d57f1eba'], cwd=/home/jking/GitPython, universal_newlines=False, shell=None)
git.test.lib.helper: INFO: Test Tutorials.test_init_repo_object failed, output is at '/tmp/test_init_repo_objectm8st37bo'
--------------------- >> end captured logging << ---------------------
Although the test seems to make you want to think it's okay, the assertion fails and the test actually fails.
Then I run into:
======================================================================
ERROR: test_init_repo_object (git.test.test_docs.Tutorials)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/src/git/test/lib/helper.py", line 92, in wrapper
return func(self, path)
File "/src/git/test/test_docs.py", line 138, in test_init_repo_object
bare_master = bare_repo.create_head('master', origin.refs.master)
File "/src/git/util.py", line 886, in __getattr__
return list.__getattribute__(self, attr)
AttributeError: 'IterableList' object has no attribute 'origin/master'
-------------------- >> begin captured stdout << ---------------------
Again this is because I have changes locally on a branch, which is best practices even if you are on your own fork.