| |
@@ -25,6 +25,7 @@
|
| |
print(cp.stdout)
|
| |
|
| |
def setUp(self):
|
| |
+ self.orig_path = os.getcwd()
|
| |
# Create git repository with some basic content
|
| |
self.repo = tempfile.mkdtemp(prefix='test_current_branch_')
|
| |
self.cmd(['git', 'init'])
|
| |
@@ -37,6 +38,8 @@
|
| |
|
| |
def tearDown(self):
|
| |
shutil.rmtree(self.repo)
|
| |
+ # Change back to original working directory
|
| |
+ os.chdir(self.orig_path)
|
| |
|
| |
|
| |
class TestGetDefaultBranch(GitTestCase):
|
| |
Some of the tests need to run in a clone of a git repo. However we need to make sure we change back to the original working directory. Otherwise generating test coverage fails as it tries to write it into current working dir, which no longer exists.