glasgowcompbio / vimms

A programmable and modular LC/MS simulator in Python
MIT License
19 stars 6 forks source link

Single unit test results are different from running all unit tests #218

Closed joewandy closed 3 years ago

joewandy commented 3 years ago

Try to run e.g. test_TopN_controller_with_simulated_chems by itself, and compare the result with running test_TopN_controller_with_simulated_chems as part of running all the tests. The generated mzML files in the two cases are different. This means there are some global states that are somehow shared across all tests, affecting the test results depending on the order they are run?

We should really fix this so each test is independent of others!

https://stackoverflow.com/questions/51050076/with-pytest-why-are-single-test-results-different-from-running-all-tests

joewandy commented 3 years ago

False alarm. This is due to the randomness in some unit tests. We should properly fix the seed instead.