Skip to content

Commit d22df2d

Browse files
test: Clean up path fixtures
config_path and changelog_path rely on the modified CWD provided by tmp_commitizen_project, so they should use this fixture.
1 parent 05c8d8c commit d22df2d

File tree

2 files changed

+5
-11
lines changed

2 files changed

+5
-11
lines changed

Diff for: tests/commands/conftest.py

+1-6
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,5 @@ def config_customize():
4444

4545

4646
@pytest.fixture()
47-
def changelog_path() -> str:
47+
def changelog_path(tmp_commitizen_project) -> str:
4848
return os.path.join(os.getcwd(), "CHANGELOG.md")
49-
50-
51-
@pytest.fixture()
52-
def config_path() -> str:
53-
return os.path.join(os.getcwd(), "pyproject.toml")

Diff for: tests/conftest.py

+4-5
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,10 @@ def tmp_git_project(tmpdir):
1818

1919
@pytest.fixture(scope="function")
2020
def tmp_commitizen_project(tmp_git_project):
21-
with tmp_git_project.as_cwd():
22-
tmp_commitizen_cfg_file = tmp_git_project.join("pyproject.toml")
23-
tmp_commitizen_cfg_file.write("[tool.commitizen]\n" 'version="0.1.0"\n')
21+
tmp_commitizen_cfg_file = tmp_git_project.join("pyproject.toml")
22+
tmp_commitizen_cfg_file.write("[tool.commitizen]\n" 'version="0.1.0"\n')
2423

25-
yield tmp_git_project
24+
yield tmp_git_project
2625

2726

2827
def _get_gpg_keyid(signer_mail):
@@ -71,5 +70,5 @@ def config():
7170

7271

7372
@pytest.fixture()
74-
def config_path() -> str:
73+
def config_path(tmp_commitizen_project) -> str:
7574
return os.path.join(os.getcwd(), "pyproject.toml")

0 commit comments

Comments
 (0)