tox

Define timeout when tox is installing requirements

Define timeout when tox is installing requirements Question: I have a gitlab ci pipeline which basically do some stuff on the enviornment ( install python and other packages) then it simply run tox in order to run some tests. stages: – check before_script: # here you can run any commands before the pipelines start – …

Total answers: 2

Strip tox path from pytest-cov output

Strip tox path from pytest-cov output Question: When using pytest and pytest-cov with tox. My tox.ini is [tox] envlist = py3 [testenv] deps = pytest pytest-codeblocks pytest-cov commands = pytest {tty:–color=yes} {posargs} –cov=mypackagename The output will contain the full tox path of the files, e.g.: ———- coverage: platform linux, python 3.11.1-final-0 ———– Name Stmts Miss …

Total answers: 1

ModuleNotFoundError on GitHub tox test run

ModuleNotFoundError on GitHub tox test run Question: running tests on GitHub and getting the error message below. Weirdly, this error did not occur with the same setup before. Run python -m tox — –junit-xml pytest.xml py38: install_deps> python -I -m pip install pytest pytest-benchmark pytest-xdist tox: py38 py38: commands[0]> pytest tests/ –ignore=tests/lab_extension –junit-xml pytest.xml ImportError …

Total answers: 1

How do I toggle verbose mode for all commands inside tox.ini in a simpler way?

How do I toggle verbose mode for all commands inside tox.ini in a simpler way? Question: Let us say I have a lot of commands inside my tox.ini commands = poetry install -v poetry run pytest –typeguard-packages=news –xdoctest –cov -vv poetry run flake8 –verbose poetry run black src tests –verbose poetry run isort . –verbose …

Total answers: 1

Poetry + Tox + Pytest seems to ALWAYS run every test

Poetry + Tox + Pytest seems to ALWAYS run every test Question: I have an issue with poetry + tox + pytest where if I run poetry run tox tests or poetry run tox py39-test every test env runs. Additionally, if I use py39-test, then it seems to skip the pytest commands all together. Using …

Total answers: 1

Copy and install packages within tox and set environment variables like you would in a Dockerfile

Copy and install packages within tox and set environment variables like you would in a Dockerfile Question: In my Dockerfile I have this: ENV WORKDIR /home ENV PYTHONPATH $WORKDIR WORKDIR $WORKDIR COPY resources/ $WORKDIR # Install the JAVA RUN tar -xvzf jdk-8u202-linux-x64.tar.gz -C /usr/ RUN rm jdk-8u202-linux-x64.tar.gz ENV JAVA_HOME ../usr/jdk1.8.0_202 RUN export JAVA_HOME Can I …

Total answers: 1

Is there a way to ask tox to run environments matching a name or by group?

Is there a way to ask tox to run environments matching a name or by group? Question: I have a tox.ini with several envs, like this example: [tox] envlist = py37, py38, py39, lint-{foo,bar,baz} … For several of my users, only a subset of these is useful at a time, usually all the py3 ones …

Total answers: 2

How to clean a tox environment after running?

How to clean a tox environment after running? Question: I have the following tox.ini file: [tox] envlist = flake8,py{35,36,37,38}{,-keyring} [testenv] usedevelop = True install_command = pip install -U {opts} {packages} deps = .[test] keyring: .[keyring] setenv = COVERAGE_FILE = .coverage.{envname} commands= pytest {toxinidir}/tests -n 4 {posargs} [testenv:flake8] basepython = python3 deps = flake8 commands= flake8 …

Total answers: 4

How to get tox to test "named" test environments with different python versions?

How to get tox to test "named" test environments with different python versions? Question: e.g. Let’s say I have following in tox.ini [tox] envlist = py27, py35, testenv2 [testenv] # settings related to “default” testenv – includes deps, commands [testenv:testenv2] # settings related to testenv2 – includes deps, commands Now when I run tox command, …

Total answers: 4

How to run only one test in tox?

How to run only one test in tox? Question: I’m trying to write a new test for a project and I’d like to test only that one test in tox. I’m already completely sure that other tests are fine, I don’t need them being run every time. The only suggestion I’ve found doesn’t work with …

Total answers: 2