Skip to content

Commit 3035cc6

Browse files
committed
fix wd in tests
1 parent 811ec01 commit 3035cc6

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

tests/test_util.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,8 @@ def setup_commit_history(testproject_path):
116116
except:
117117
os.chdir(str(cwd))
118118
raise
119-
119+
120+
os.chdir(cwd)
120121
return repo
121122

122123
#### Tests ####
@@ -125,6 +126,7 @@ def setup_commit_history(testproject_path):
125126
def test_empty_file(tmp_path):
126127

127128
# Change working directory
129+
cwd = os.getcwd()
128130
os.chdir(str(tmp_path))
129131

130132
# Create empty file
@@ -151,6 +153,7 @@ def test_empty_file(tmp_path):
151153
authors = repo_instance.get_authors()
152154
assert authors == []
153155

156+
os.chdir(cwd)
154157
## TODO
155158
# When the first instance of a commit on a page is skipped as an empty line,
156159
# the second instance will not have the commit metadata available
@@ -162,6 +165,7 @@ def test_retrieve_authors(tmp_path):
162165
Args:
163166
tmp_path (PosixPath): Directory of a tempdir
164167
"""
168+
cwd = os.getcwd()
165169
os.chdir(str(tmp_path))
166170

167171
# Create file
@@ -253,6 +257,7 @@ def test_retrieve_authors(tmp_path):
253257
'contribution' : '66.67%',
254258
'contribution_all_pages': '66.67%'
255259
}]
260+
os.chdir(cwd)
256261

257262
def test_summarize_authors():
258263
"""

0 commit comments

Comments
 (0)