Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tox command not running unittests #63

Closed
peterschutt opened this issue Mar 17, 2021 · 3 comments
Closed

tox command not running unittests #63

peterschutt opened this issue Mar 17, 2021 · 3 comments

Comments

@peterschutt
Copy link
Contributor

I'm fairly new to using tox in my own projects so I'd have to do some digging to work out a fix, but if I insert an explicitly failing test, the tox command still returns successes. I think it is just building each environment but not running the tests on them.

To Reproduce
See PR #62 which I've made as demonstration that the CI tests pass.

Expected behavior
CI should fail.

@peterschutt
Copy link
Contributor Author

I'm pretty sure I struggled to work this out with my own libs and just ended up putting the extras=... and the commands=... into the [testenv] section. This is the tox.ini from my template library project:

[tox]
envlist=lint,py38,py39
isolated_build=true

[testenv]
description=Runs pytest tests in each of the py environs
extras=tests
commands=
    pytest --cov={envsitepackagesdir}/penguin

[testenv:lint]
description=Lint project files
extras=lint
commands =
    isort --check --diff .
    black --check --diff .
    flake8 src/ tests/
    mypy src tests

I don't know if that is good or bad practice but it ends up running linting on the environment python and unittests on the two specified python versions.

@MikeWooster
Copy link
Owner

Many thanks. I'll take a look and see if I can fix this and #61

@MikeWooster
Copy link
Owner

fixed in #64

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants