[Review Needed]Pytest Style coordinates/test_timestep_api.py - #1650
Conversation
orbeckst
left a comment
There was a problem hiding this comment.
Please check the code related to importorskip(netCDF4). It is likely not needed anymore and can be simplified.
| def setUp(self): | ||
| @pytest.fixture() | ||
| def universe(self): | ||
| pytest.importorskip('netCDF4') |
There was a problem hiding this comment.
I don't think that we need to check for netCDF anymore. We should always be able to read ncdf files because we use scipy.io.netcdf for reading.
There was a problem hiding this comment.
Does this mean that pytest.importorskip('netCDF4') shouldn't be present anywhere in the tests as we don't use it anymore?
There was a problem hiding this comment.
With git grep I only found it in MDAnalysisTests/coordinates/test_xdr.py and there it is also not needed anymore. We should always be able to read NCDF files.
There was a problem hiding this comment.
(I must have overlooked these instances when I worked on #506 so thanks for fixing them as you go along.)
| timeunit='fs') | ||
| self.ts = u.trajectory.ts | ||
|
|
||
| class TestNCDFBaseTimestepInterface(object): |
There was a problem hiding this comment.
Does this separate class solely exist so that you can test for netCDF4? If so, this is not necessary anymore.
Could you then get rid of this class and do everything in the pararmeterized class? (You are already loading ncdf files in the parametrization anyway...).
| # Once Readers use that TestClass, delete this one | ||
| class BaseTimestepInterfaceTest(TestCase): | ||
|
|
||
| @pytest.mark.parametrize("topology, trajectory, trajectory_format, topology_format", ( |
|
@orbeckst Should be good to go now. |
Fixes #
Changes made in this Pull Request:
PR Checklist