Conversation
| return None if b"eraA2af" in out else pytest.skip(reason="system liberfa") | ||
|
|
||
|
|
||
| class TestVersion: |
There was a problem hiding this comment.
The tests in this class do not share any setup or teardown, so the only reason for bundling them together in a class that I can think of is to allow running only version tests with pytest erfa/tests/test_erfa.py::TestVersion. But in practice pytest -k version works just as well and does not require implementing a separate class. If it really is important to separate version tests from others then they should be in a separate module.
|
|
||
| class TestVersion: | ||
| def test_erfa_version(self): | ||
| assert hasattr(erfa.version, 'erfa_version') |
There was a problem hiding this comment.
These assert hasattr() checks do not serve a useful purpose. If the attribute is missing then trying to access it will cause an AttributeError, but pytest can catch and report those just fine.
| def test_erfa_version(self): | ||
| assert hasattr(erfa.version, 'erfa_version') | ||
| erfa_version = erfa.version.erfa_version | ||
| assert isinstance(erfa_version, str) |
There was a problem hiding this comment.
If types have to be checked in unit tests then the check should be as strict as possible.
No description provided.