Skip to content

Commit 89162b5

Browse files
committed
try with os
1 parent fb81746 commit 89162b5

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

test/conftest.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -32,5 +32,10 @@ def xtl_clone(git2cpp_path):
3232

3333
@pytest.fixture
3434
def git_config(git2cpp_path, monkeypatch):
35-
monkeypatch.setenv("GIT_AUTHOR_NAME", "Jane Doe")
36-
monkeypatch.setenv("GIT_AUTHOR_EMAIL", "jane.doe@blabla.com")
35+
os.environ["GIT_AUTHOR_NAME"] = "Jane Doe"
36+
os.environ["GIT_AUTHOR_EMAIL"] = "jane.doe@blabla.com"
37+
38+
yield
39+
40+
del(os.environ["GIT_AUTHOR_NAME"])
41+
del(os.environ["GIT_AUTHOR_EMAIL"])

test/test_commit.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
working_dir = 'test/data/xtl'
88

99
@pytest.mark.parametrize("all_flag", ["", "-A", "--all", "--no-ignore-removal"])
10-
def test_commit(xtl_clone, git_config, git2cpp_path, monkeypatch, all_flag):
10+
def test_commit(xtl_clone, git_config, git2cpp_path, all_flag):
1111
with open("./test/data/xtl/mook_file.txt", "x"):
1212
pass
1313

0 commit comments

Comments
 (0)