dimanche 31 janvier 2016

Run py.test on package and local files in same run/session?

If I run a package's test with:

py.test --pyargs package

I seem to lose the discovery of other tests from testpaths in my ini files. Is there a way to combine local tests from files and do package / module tests in one session? I'm looking for a way to programmatically run tests on a bunch of packages and run custom tests in local files in one run, but seemed stumped. If I could figure out how to collect package tests by calls in the tests in the local files, that would also solve my problem (as in if I could do something like:

def test_that_package():
    magically_collect_and_run_package_tests(package.tests())

) I just don't see if there are hooks for that either in py.test or in a plugin.

Aucun commentaire:

Enregistrer un commentaire