mirror of
https://github.com/TECHNOFAB11/bumpver.git
synced 2025-12-12 06:20:08 +01:00
Fix catchall exceptions.
Using ValueError for everything caused underlying issues to be hidden. Now there are explicit classes for each error condition.
This commit is contained in:
parent
4c03738938
commit
69fadc2de9
5 changed files with 34 additions and 19 deletions
|
|
@ -77,8 +77,8 @@ def test_error_bad_path():
|
|||
(project.dir / "setup.py").unlink()
|
||||
try:
|
||||
list(rewrite._iter_file_paths(cfg.file_patterns))
|
||||
assert False, "expected ValueError"
|
||||
except ValueError as ex:
|
||||
assert False, "expected FileNotFoundError"
|
||||
except FileNotFoundError as ex:
|
||||
assert "setup.py" in str(ex)
|
||||
|
||||
|
||||
|
|
@ -93,6 +93,5 @@ def test_error_bad_pattern():
|
|||
|
||||
try:
|
||||
list(rewrite.diff("v201809.1234", patterns))
|
||||
assert False, "expected ValueError"
|
||||
except ValueError as ex:
|
||||
except rewrite.NoPatternMatch as ex:
|
||||
assert "setup.py" in str(ex)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue