Created
March 14, 2023 17:36
-
-
Save szabi/b4fa87c7a70e83fbaafb32828861209b to your computer and use it in GitHub Desktop.
Accompanying tox issue
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
REM With single envs it works as expected: | |
REM expecting: nothing printed, no FAIL | |
tox -q run -e py310-ok & if ERRORLEVEL 1 echo FAIL | |
REM (OK) expectation met. | |
REM expecting FAIL: | |
tox -q run -e py310-fail & if ERRORLEVEL 1 echo FAIL | |
REM (OK) expectation met. | |
REM With multiple envs it does not work as expected! | |
REM expecting no fail, as ALL environments were ok | |
tox -q run -e py310-ok,py310-ok2 & if ERRORLEVEL 1 echo FAIL | |
REM (OK) expectation met. | |
REM expecting to FAIL as at least one environment has failed: | |
tox -q run -e py310-ok,py310-fail & if ERRORLEVEL 1 echo FAIL | |
REM (NOT_OK) expectation *not* met | |
REM expecting to FAIL as all environments have failed: | |
tox -q run -e py310-fail,py310-fail2 & if ERRORLEVEL 1 echo FAIL | |
REM (NOT_OK) expectation *not* met |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if __name__ == '__main__': | |
print("Running main") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[options] | |
packages = find: | |
[options.packages.find] | |
where = . | |
include = main.py |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_fail(): | |
assert False |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def test_ok(): | |
assert True |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[tox] | |
env_list = | |
py310-{ok,ok2,fail,fail2} | |
minversion = 4.4.6 | |
[testenv] | |
py_modules = | |
main.py | |
description = run the tests with pytest | |
package = wheel | |
wheel_build_env = .pkg | |
deps = | |
pytest | |
[testenv:py310-ok] | |
commands = | |
pytest {tty:--color=yes} test_ok.py {posargs} | |
[testenv:py310-ok2] | |
commands = | |
pytest {tty:--color=yes} test_ok.py {posargs} | |
[testenv:py310-fail] | |
commands = | |
pytest {tty:--color=yes} test_fail.py {posargs} | |
[testenv:py310-fail2] | |
commands = | |
pytest {tty:--color=yes} test_fail.py {posargs} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment