Skip to content

Commit

Permalink
Fixed error message which changes from python version to python version.
Browse files Browse the repository at this point in the history
  • Loading branch information
hiker committed Apr 23, 2024
1 parent c296d2e commit b09f707
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/unit_tests/test_artefacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ class MyClass(ArtefactsGetter):

with pytest.raises(TypeError) as err:
_ = MyClass()
assert ("Can't instantiate abstract class MyClass with abstract method "
"__call_" in str(err.value))
# The actual error messages changes slightly from python
# version to version:
# 3.7: ... with abstract methods
# 3.8: ... with abstract method
# 3.12: ... without an implementation for abstract
# so we only test for the begin which is identical:
assert "Can't instantiate abstract class MyClass with" in str(err.value)

# Now test that we can raise the NotImplementedError
# --------------------------------------------------
Expand Down

0 comments on commit b09f707

Please sign in to comment.