You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
asserttest_dir+".meta"notinos.listdir(), f"{var} did not copy meta!"
asserttest_dir+".data"notinos.listdir(), f"{var} did not copy data!"
causes the test to never actually run. The reasoning is as follows. This test copies the files "U", "V", and "T" to "datatestU/V/T" which the extra_variables capability can handle. The if statement seems to be checking if "U", "V", "T" are in the test data in the first place, and if they are not, skip this test. However, it does this by looking at os.listdir(), which lists the contents of the current working directory not the location of the test data. So, this should be changed to os.listdir(dirname), which is the location of the test data.
If we do this, we arrive at the second and potentially more challenging problem. The test is now doing what it's supposed to, but it fails. However, it doesn't fail because of a problem with extra_variables, it fails because (I think) some mutable object is getting changed somewhere in the test module. My reasoning for this is because we can get the module to pass all tests if we simply put test_extra_variables to be the first test (or at least before test_open_mdsdataset_minimal). Another fix to the problem is by setting the "scope" of the fixture all_mds_datadirs to "function" rather than "module", here:
Changing the scope of the fixture seems fine... but my concern is that the problem could be arising from somewhere in open_mdsdataset rather than in the test module(s) themselves. I'm not really sure and I'm curious if anyone has any thoughts on this. I'll be looking into it periodically when I can. I have written a very similar test as test_extra_variables but for the custom_grid_variables capability in #308, so I'd rather have this figured out before merging that PR.
The text was updated successfully, but these errors were encountered:
First off, I think this
if
statement intest_extra_variables
:xmitgcm/xmitgcm/test/test_mds_store.py
Lines 588 to 595 in 63ba751
causes the test to never actually run. The reasoning is as follows. This test copies the files "U", "V", and "T" to "datatestU/V/T" which the
extra_variables
capability can handle. The if statement seems to be checking if "U", "V", "T" are in the test data in the first place, and if they are not, skip this test. However, it does this by looking atos.listdir()
, which lists the contents of the current working directory not the location of the test data. So, this should be changed toos.listdir(dirname)
, which is the location of the test data.If we do this, we arrive at the second and potentially more challenging problem. The test is now doing what it's supposed to, but it fails. However, it doesn't fail because of a problem with
extra_variables
, it fails because (I think) some mutable object is getting changed somewhere in the test module. My reasoning for this is because we can get the module to pass all tests if we simply puttest_extra_variables
to be the first test (or at least beforetest_open_mdsdataset_minimal
). Another fix to the problem is by setting the "scope" of the fixtureall_mds_datadirs
to "function" rather than "module", here:xmitgcm/xmitgcm/test/test_xmitgcm_common.py
Lines 281 to 283 in 63ba751
Changing the scope of the fixture seems fine... but my concern is that the problem could be arising from somewhere in
open_mdsdataset
rather than in the test module(s) themselves. I'm not really sure and I'm curious if anyone has any thoughts on this. I'll be looking into it periodically when I can. I have written a very similar test astest_extra_variables
but for thecustom_grid_variables
capability in #308, so I'd rather have this figured out before merging that PR.The text was updated successfully, but these errors were encountered: