Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6012d9e

Browse files
committed
test: fixed issues with conf
1 parent 0c7fb0c commit 6012d9e

File tree

3 files changed

+3
-8
lines changed

3 files changed

+3
-8
lines changed

‎commitizen/config.py‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,9 @@
99
from commitizen import defaults
1010

1111

12-
_conf_path: Optional[str] = None
13-
14-
1512
class Config:
1613
def __init__(self):
17-
self._config = defaults.settings
14+
self._config = defaults.settings.copy()
1815
self._path: Optional[str] = None
1916

2017
@property
@@ -112,12 +109,10 @@ def read_cfg() -> dict:
112109
continue
113110
with open(filename, "r") as f:
114111
data: str = f.read()
115-
116112
if "toml" in filename:
117113
conf = read_pyproject_conf(data)
118114
else:
119115
conf = read_raw_parser_conf(data)
120-
121116
if not conf:
122117
continue
123118

‎tests/test_bump_update_version_in_files.py‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,5 +39,4 @@ def test_update_version_in_files(create_files):
3939
for filepath in create_files:
4040
with open(filepath, "r") as f:
4141
data = f.read()
42-
print(data)
4342
assert new_version in data

‎tests/test_conf.py‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050

5151
@pytest.fixture
5252
def configure_supported_files():
53+
config._conf = config.Config()
5354
original = defaults.config_files.copy()
5455

5556
# patch the defaults to include tests
@@ -133,7 +134,7 @@ def test_conf_returns_default_when_no_files(configure_supported_files):
133134
@pytest.mark.parametrize(
134135
"config_files_manager", defaults.config_files.copy(), indirect=True
135136
)
136-
def test_set_key(config_files_manager, configure_supported_files):
137+
def test_set_key(configure_supported_files, config_files_manager):
137138
config.read_cfg()
138139
config.set_key("version", "2.0.0")
139140
cfg = config.read_cfg()

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /