Skip to content

Commit d2fd475

Browse files
committed
try with monkeypatch and committer
1 parent f03ec24 commit d2fd475

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

test/conftest.py

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,6 @@ def xtl_clone(git2cpp_path):
3131
subprocess.run(cleanup_cmd, capture_output=True, cwd = clone_working_dir, text=True)
3232

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

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, all_flag):
10+
def test_commit(xtl_clone, git_config, git2cpp_path, monkeypatch, all_flag):
1111
with open("./test/data/xtl/mook_file.txt", "x"):
1212
pass
1313

0 commit comments

Comments
 (0)