Allow running commands before and after running tests in all environments

Issue #275 on hold
Brecht Machiels
created an issue

This is only relevant for detox. Beside envlist, we could introduce setupenv and breakdownenv.

This could be useful to combine the coverage data for projects with a unified Python 2/3 codebase. In this case coverage can never be 100% due to Python 2/3-specific code paths, so it makes sense to combine them.

Comments (11)

  1. Ivan Smirnov

    Yea, this would be very useful in general -- some setup like coverage erase and whatnot before running the envs, and finalization/cleanup like coverage combine / coverage report afterwards.

    Should it be completely unconditional though? E.g., you may want to run tox -e lint in which case it doesn't really make sense to run coverage setup/teardown. How would you set that up?

    Maybe the better naming would be something like before_test and after_test (aking to the commonly naming scheme on Travis)?

  2. Holger Krekel repo owner

    @itxaka i am slowly getting back to tox issues FWIW. There are a few people who do good PRs but not yet others who review and merge PRs, handle other's issues, do releases etc.

    As to this issue here it guess it makes sense to introduce and document hooks. I am happy about a PR (referencing this issue275) -- you could start with just putting up your tox-plus as a PR unchanged to see what you changed. We can take it from there.

  3. itxaka serrano

    @Holger Krekel that sounds great! I will try to do the diff this afternoon, as my patch for that part....well, lets say Im not too sure its the proper way of doing it as I kind of did a trial and error approach as we didnt had that much time to implement it properly.

  4. Matthew Schinckel

    I'm not sure it's only relevant to detox: I have a similar patch (that I'll update to match the requirements detailed from PR175) that allows me to report each venv as a seperate "build" back to bitbucket.

  5. Hynek Schlawack

    I’ve tried to understand what runtest_pre/post does by jumping through the commits and it seems to allow per-env hooks and not hooks for “before anything happens” and ”after everything is done”. Am I missing something? Are there any docs I haven’t found?

  6. Log in to comment