lsst-sims / legacy_sims_catUtils

LSST Simulations package for catalog utilities
3 stars 4 forks source link

SIM-2425: Work with pytest-xdist #85

Closed timj closed 7 years ago

timj commented 7 years ago

This is a work in progress. Not ready for release.

The main thrust is to use temporary file names and temporary scratch space so that multiple processes can run tests from the same class. This work is similar to that in lsst/sims_catalogs#13

timj commented 7 years ago

This all seems to be working now (I managed to do a pytest -n 4 tests/tests*.py).

rbiswas4 commented 7 years ago

I actually was only reviewing the parts relating to SN and had tried to approve those changes. I actually have not reviewed all of it (thinking that Scott might have other thoughts, but this shows up as an approved review for the entire PR.

timj commented 7 years ago

Thank @rbiswas4 -- I've added @danielsf as reviewer.

timj commented 7 years ago

Yes. I deliberately used mktemp because I didn't want to have to delete the file that mkstemp created. I also thought the chances of a random clash during testing were low and I don't think that anyone is going to try to guess the file as a way to attack the process running the tests. If you are going to insist on mkstemp I'll switch.

danielsf commented 7 years ago

No need to change. I just wanted to make sure you were aware.

I just got a failure of testFastLightCurveGenerator.py on my local system. Let me diagnose that, then I will mark this as 'approved'.

danielsf commented 7 years ago

This is ready to merge (there was a block of mis-indented code that was causing a failure in python 2 but not python 3)

timj commented 7 years ago

Thanks. Python really doesn't like big blocks where it's hard to get the indent right...