@@ -59,131 +59,6 @@ def test_file_args_marked_to_modify(self, mocker, tmp_path: Path):
59
59
assert passed_config .files [0 ].filename == "do-this-file.txt"
60
60
61
61
62
- class TestListOption :
63
- """Test the deprecated --list option."""
64
-
65
- def test_with_version_part_includes_new_version (self , tmp_path : Path , fixtures_path : Path ):
66
- """The --list option should list the configuration with new_version."""
67
- # Arrange
68
- config_path = tmp_path / "pyproject.toml"
69
- toml_path = fixtures_path / "basic_cfg.toml"
70
- shutil .copy (toml_path , config_path )
71
- runner : CliRunner = CliRunner ()
72
-
73
- with inside_dir (tmp_path ):
74
- result : Result = runner .invoke (cli .cli , ["bump" , "--list" , "patch" ])
75
-
76
- if result .exit_code != 0 :
77
- print (result .output )
78
- print (result .exception )
79
-
80
- assert result .exit_code == 0
81
- assert set (result .output .splitlines (keepends = False )) == {
82
- "WARNING:" ,
83
- "" ,
84
- "DEPRECATED: The --list option is deprecated and will be removed in a future version." ,
85
- "new_version=1.0.1-dev" ,
86
- "current_version=1.0.0" ,
87
- "excluded_paths=[]" ,
88
- "parse=(?P<major>\\ d+)\\ .(?P<minor>\\ d+)\\ .(?P<patch>\\ d+)(\\ -(?P<release>[a-z]+))?" ,
89
- "serialize=('{major}.{minor}.{patch}-{release}', '{major}.{minor}.{patch}')" ,
90
- "search={current_version}" ,
91
- "replace={new_version}" ,
92
- "regex=False" ,
93
- "ignore_missing_files=False" ,
94
- "ignore_missing_version=False" ,
95
- "included_paths=[]" ,
96
- "tag=True" ,
97
- "sign_tags=False" ,
98
- "tag_name=v{new_version}" ,
99
- "tag_message=Bump version: {current_version} → {new_version}" ,
100
- "allow_dirty=False" ,
101
- "commit=True" ,
102
- "message=Bump version: {current_version} → {new_version}" ,
103
- "commit_args=None" ,
104
- (
105
- "files=[{'parse': "
106
- "'(?P<major>\\ \\ d+)\\ \\ .(?P<minor>\\ \\ d+)\\ \\ .(?P<patch>\\ \\ d+)(\\ \\ -(?P<release>[a-z]+))?', "
107
- "'serialize': ('{major}.{minor}.{patch}-{release}', "
108
- "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': "
109
- "'{new_version}', 'regex': False, 'ignore_missing_version': False, "
110
- "'ignore_missing_file': False, 'filename': 'setup.py', 'glob': None, 'key_path': None}, {'parse': "
111
- "'(?P<major>\\ \\ d+)\\ \\ .(?P<minor>\\ \\ d+)\\ \\ .(?P<patch>\\ \\ d+)(\\ \\ -(?P<release>[a-z]+))?', "
112
- "'serialize': ('{major}.{minor}.{patch}-{release}', "
113
- "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': "
114
- "'{new_version}', 'regex': False, 'ignore_missing_version': False, "
115
- "'ignore_missing_file': False, 'filename': 'bumpversion/__init__.py', 'glob': None, 'key_path': None}, "
116
- "{'parse': "
117
- "'(?P<major>\\ \\ d+)\\ \\ .(?P<minor>\\ \\ d+)\\ \\ .(?P<patch>\\ \\ d+)(\\ \\ -(?P<release>[a-z]+))?', "
118
- "'serialize': ('{major}.{minor}.{patch}-{release}', "
119
- "'{major}.{minor}.{patch}'), 'search': '**unreleased**', 'replace': "
120
- "'**unreleased**\\ n**v{new_version}**', 'regex': False, "
121
- "'ignore_missing_version': False, 'ignore_missing_file': False, 'filename': 'CHANGELOG.md', "
122
- "'glob': None, 'key_path': None}]"
123
- ),
124
- }
125
-
126
- def test_without_version_part_excludes_new_version (self , tmp_path : Path , fixtures_path : Path ):
127
- """The --list option should list the configuration without new_version."""
128
- # Arrange
129
- config_path = tmp_path / "pyproject.toml"
130
- toml_path = fixtures_path / "basic_cfg.toml"
131
- shutil .copy (toml_path , config_path )
132
- runner : CliRunner = CliRunner ()
133
-
134
- with inside_dir (tmp_path ):
135
- result : Result = runner .invoke (cli .cli , ["bump" , "--list" ])
136
-
137
- if result .exit_code != 0 :
138
- print (result .output )
139
- print (result .exception )
140
-
141
- assert result .exit_code == 0
142
- assert set (result .output .splitlines (keepends = False )) == {
143
- "WARNING:" ,
144
- "" ,
145
- "DEPRECATED: The --list option is deprecated and will be removed in a future version." ,
146
- "current_version=1.0.0" ,
147
- "excluded_paths=[]" ,
148
- "parse=(?P<major>\\ d+)\\ .(?P<minor>\\ d+)\\ .(?P<patch>\\ d+)(\\ -(?P<release>[a-z]+))?" ,
149
- "serialize=('{major}.{minor}.{patch}-{release}', '{major}.{minor}.{patch}')" ,
150
- "search={current_version}" ,
151
- "replace={new_version}" ,
152
- "regex=False" ,
153
- "ignore_missing_files=False" ,
154
- "ignore_missing_version=False" ,
155
- "included_paths=[]" ,
156
- "tag=True" ,
157
- "sign_tags=False" ,
158
- "tag_name=v{new_version}" ,
159
- "tag_message=Bump version: {current_version} → {new_version}" ,
160
- "allow_dirty=False" ,
161
- "commit=True" ,
162
- "message=Bump version: {current_version} → {new_version}" ,
163
- "commit_args=None" ,
164
- (
165
- "files=[{'parse': "
166
- "'(?P<major>\\ \\ d+)\\ \\ .(?P<minor>\\ \\ d+)\\ \\ .(?P<patch>\\ \\ d+)(\\ \\ -(?P<release>[a-z]+))?', "
167
- "'serialize': ('{major}.{minor}.{patch}-{release}', "
168
- "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': "
169
- "'{new_version}', 'regex': False, 'ignore_missing_version': False, "
170
- "'ignore_missing_file': False, 'filename': 'setup.py', 'glob': None, 'key_path': None}, {'parse': "
171
- "'(?P<major>\\ \\ d+)\\ \\ .(?P<minor>\\ \\ d+)\\ \\ .(?P<patch>\\ \\ d+)(\\ \\ -(?P<release>[a-z]+))?', "
172
- "'serialize': ('{major}.{minor}.{patch}-{release}', "
173
- "'{major}.{minor}.{patch}'), 'search': '{current_version}', 'replace': "
174
- "'{new_version}', 'regex': False, 'ignore_missing_version': False, "
175
- "'ignore_missing_file': False, 'filename': 'bumpversion/__init__.py', 'glob': None, 'key_path': None}, "
176
- "{'parse': "
177
- "'(?P<major>\\ \\ d+)\\ \\ .(?P<minor>\\ \\ d+)\\ \\ .(?P<patch>\\ \\ d+)(\\ \\ -(?P<release>[a-z]+))?', "
178
- "'serialize': ('{major}.{minor}.{patch}-{release}', "
179
- "'{major}.{minor}.{patch}'), 'search': '**unreleased**', 'replace': "
180
- "'**unreleased**\\ n**v{new_version}**', 'regex': False, "
181
- "'ignore_missing_version': False, 'ignore_missing_file': False, 'filename': 'CHANGELOG.md', "
182
- "'glob': None, 'key_path': None}]"
183
- ),
184
- }
185
-
186
-
187
62
def test_bump_nested_regex (tmp_path : Path , fixtures_path : Path , caplog ):
188
63
"""
189
64
Arrange/Act: Run the `bump` subcommand with --no-configured-files.
0 commit comments