11import json
2- import os
32from pathlib import Path
43
54import pytest
4140}
4241
4342
44- _settings = {
43+ _read_settings = {
4544 "name" : "cz_jira" ,
4645 "version" : "1.0.0" ,
4746 "tag_format" : "$version" ,
7978 "prerelease_offset" : 0 ,
8079}
8180
82- _read_settings = {
83- "name" : "cz_jira" ,
84- "version" : "1.0.0" ,
85- "version_files" : ["commitizen/__version__.py" , "pyproject.toml" ],
86- "style" : [["pointer" , "reverse" ], ["question" , "underline" ]],
87- "changelog_file" : "CHANGELOG.md" ,
88- "pre_bump_hooks" : ["scripts/generate_documentation.sh" ],
89- "post_bump_hooks" : ["scripts/slack_notification.sh" ],
90- }
91-
9281
9382@pytest .fixture
9483def config_files_manager (request , tmpdir ):
@@ -105,7 +94,7 @@ def config_files_manager(request, tmpdir):
10594
10695
10796def test_find_git_project_root (tmpdir ):
108- assert git .find_git_project_root () == Path (os . getcwd ())
97+ assert git .find_git_project_root () == Path (__file__ ). parent . parent
10998
11099 with tmpdir .as_cwd () as _ :
111100 assert git .find_git_project_root () is None
@@ -127,7 +116,7 @@ class TestReadCfg:
127116 )
128117 def test_load_conf (_ , config_files_manager ):
129118 cfg = config .read_cfg ()
130- assert cfg .settings == _settings
119+ assert cfg .settings == _read_settings
131120
132121 def test_conf_returns_default_when_no_files (_ , tmpdir ):
133122 with tmpdir .as_cwd ():
@@ -142,7 +131,7 @@ def test_load_empty_pyproject_toml_and_cz_toml_with_config(_, tmpdir):
142131 p .write (PYPROJECT )
143132
144133 cfg = config .read_cfg ()
145- assert cfg .settings == _settings
134+ assert cfg .settings == _read_settings
146135
147136
148137class TestTomlConfig :
0 commit comments