Open siranipour opened 4 years ago
I think having things that take time to initialize at import time is in general a bad idea, and so fixtures should definitively be used in that case. Other than that, if we can find a way to tell sphinx to ignore the tests so much the better.
I noticed that when we
make html
the docs, sphinx interprets the CI tests. This is fine, since mostly they are just function definition, but sometimes there are unguarded global lines e.g:https://github.com/NNPDF/nnpdf/blob/67c86db33cd279348edbac72f6e0df19f4cfbcca/validphys2/src/validphys/tests/test_calcutils.py#L9
Now this is not much overhead, but the trouble is the
pseudodata
tests take a non negligible time to to initialize. I shall fix this particular one in #746, but it's something we should probably know about.Note the following: https://docs.pytest.org/en/stable/fixture.html