@@ -186,18 +186,18 @@ def test_unknown_args_before_double_dash_raises(mocker: MockFixture): |
186 | 186 |
|
187 | 187 |
|
188 | 188 | def test_commitizen_excepthook_non_commitizen_exception(mocker: MockFixture): |
189 | | - """Test that commitizen_excepthook delegates to original_excepthook for non-CommitizenException.""" |
| 189 | + """Test that commitizen_excepthook delegates to sys.__excepthook__ for non-CommitizenException.""" |
190 | 190 | # Mock the original excepthook |
191 | 191 | mock_original_excepthook = mocker.Mock() |
192 | | - mocker.patch("commitizen.cli.original_excepthook", mock_original_excepthook) |
| 192 | + mocker.patch("commitizen.cli.sys.__excepthook__", mock_original_excepthook) |
193 | 193 |
|
194 | 194 | # Create a regular exception |
195 | 195 | test_exception = ValueError("test error") |
196 | 196 |
|
197 | 197 | # Call commitizen_excepthook with the regular exception |
198 | 198 | cli.commitizen_excepthook(ValueError, test_exception, None) |
199 | 199 |
|
200 | | - # Verify original_excepthook was called with correct arguments |
| 200 | + # Verify sys.__excepthook__ was called with correct arguments |
201 | 201 | mock_original_excepthook.assert_called_once_with(ValueError, test_exception, None) |
202 | 202 |
|
203 | 203 |
|
@@ -207,7 +207,7 @@ def test_commitizen_excepthook_non_commitizen_exception_with_traceback( |
207 | 207 | """Test that commitizen_excepthook handles traceback correctly for non-CommitizenException.""" |
208 | 208 | # Mock the original excepthook |
209 | 209 | mock_original_excepthook = mocker.Mock() |
210 | | - mocker.patch("commitizen.cli.original_excepthook", mock_original_excepthook) |
| 210 | + mocker.patch("commitizen.cli.sys.__excepthook__", mock_original_excepthook) |
211 | 211 |
|
212 | 212 | # Create a regular exception with a traceback |
213 | 213 | test_exception = ValueError("test error") |
@@ -216,7 +216,7 @@ def test_commitizen_excepthook_non_commitizen_exception_with_traceback( |
216 | 216 | # Call commitizen_excepthook with the regular exception and traceback |
217 | 217 | cli.commitizen_excepthook(ValueError, test_exception, test_traceback) |
218 | 218 |
|
219 | | - # Verify original_excepthook was called with correct arguments including traceback |
| 219 | + # Verify sys.__excepthook__ was called with correct arguments including traceback |
220 | 220 | mock_original_excepthook.assert_called_once_with( |
221 | 221 | ValueError, test_exception, test_traceback |
222 | 222 | ) |
@@ -228,7 +228,7 @@ def test_commitizen_excepthook_non_commitizen_exception_with_invalid_traceback( |
228 | 228 | """Test that commitizen_excepthook handles invalid traceback correctly for non-CommitizenException.""" |
229 | 229 | # Mock the original excepthook |
230 | 230 | mock_original_excepthook = mocker.Mock() |
231 | | - mocker.patch("commitizen.cli.original_excepthook", mock_original_excepthook) |
| 231 | + mocker.patch("commitizen.cli.sys.__excepthook__", mock_original_excepthook) |
232 | 232 |
|
233 | 233 | # Create a regular exception with an invalid traceback |
234 | 234 | test_exception = ValueError("test error") |
@@ -237,5 +237,5 @@ def test_commitizen_excepthook_non_commitizen_exception_with_invalid_traceback( |
237 | 237 | # Call commitizen_excepthook with the regular exception and invalid traceback |
238 | 238 | cli.commitizen_excepthook(ValueError, test_exception, test_traceback) |
239 | 239 |
|
240 | | - # Verify original_excepthook was called with None as traceback |
| 240 | + # Verify sys.__excepthook__ was called with None as traceback |
241 | 241 | mock_original_excepthook.assert_called_once_with(ValueError, test_exception, None) |