Closed moustakas closed 7 months ago
With the latest commit at NERSC
I get
% pytest py/desispec/test/test_photo.py
======================================================================================= test session starts =======================================================================================
platform linux -- Python 3.10.8, pytest-7.2.0, pluggy-1.0.0
rootdir: /global/u2/i/ioannis/code/desihub/desispec
plugins: astropy-header-0.1.2, filter-subpackage-0.1.1, openfiles-0.5.0, doctestplus-0.12.1, arraydiff-0.3, anyio-3.6.2, astropy-0.10.0, asdf-2.14.3, cov-4.0.0, remotedata-0.4.0, hypothesis-6.62.0, mock-3.10.0
collected 4 items
py/desispec/test/test_photo.py .... [100%]
======================================================================================= 4 passed in 25.24s ========================================================================================
The only new / different assumption I had to make was
#surveyops_dir = os.environ['DESI_SURVEYOPS']
surveyops_dir = desi_root+'/survey/ops/surveyops/trunk' # assumes a standard installation / environment
Hopefully this is alright @sbailey.
Thanks. This PR fixes the second problem listed in #2138, i.e. the failure of test_photo.py when run by itself. Good. We still have the problem that some other test is changing DESI_ROOT and not resetting it, thus breaking test_photo.py when all of the tests are run together with a single pytest
invocation. So I'll merge this PR now, but leave #2138 open until we can debug the other cross-test problem.
Tentative fix for #2138 but we'll need to confirm if this fixes this part of the issue you identified, @sbailey:
The functions in
desispec.io.photo
as well as thetest_photo
suite relies entirely ondesispec.io.meta.get_desi_root_readonly
doing the right thing, so if another unit test is changing the top-level DESI path, then I'm going to need help tracking down who/what/where.