Questions tagged [tox]

tox is a generic virtualenv management and test running tool.

tox is a generic virtualenv management and test command line tool you can use for:

  • checking your package installs correctly with different Python versions and interpreters running your tests in each of the environments,
  • configuring your test tool of choice
  • acting as a frontend to Continuous Integration servers, greatly reducing boilerplate and merging CI and shell-based testing

Resources:

529 questions
4
votes
1 answer

How to run one specific test by using tox?

This is the path to the project D:\QA\test-framework\python-client This is a test frame work implemented by python This is the python file that contains tests This is the path to the test case that I need to…
snow
  • 55
  • 1
  • 1
  • 11
4
votes
2 answers

How to built-in run python tox command and test in visual studio code

I have tox.ini in my project, and I want for running and showing test in visual studio code, using python tox, but I don't know how to do it?
sorosh_sabz
  • 2,356
  • 2
  • 32
  • 53
4
votes
1 answer

How to solve botocore.exceptions.NoCredentialsError: Unable to locate credentials

I have a GitHub action which is running a tox.ini file. One of the steps of the action is to connect to aws and the last step is to run tox - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 with: …
Oliver Robie
  • 818
  • 2
  • 11
  • 30
4
votes
1 answer

Python tox: show stdout/prints on successful test run?

Sometimes I want to print some statements, to make sure unittests are running fine (even if it passes), but can't find an option that enables it. If tests fail, then it does show custom prints as output, but if it passes, it does ignore prints or…
Andrius
  • 19,658
  • 37
  • 143
  • 243
4
votes
1 answer

How to run tox -e myenv against other environments?

Is it possible in tox to have tox -e hello trigger the hello environment and run on the global envlist? Running tox runs correctly against py2 and py3. Running tox -e hello only runs against py3. [tox] skipsdist = True envlist =…
SwimBikeRun
  • 4,192
  • 11
  • 49
  • 85
4
votes
0 answers

How to pass environment variables to Tox before installing deps?

I need 3 env variables in order to install pycurl. When i use Tox, i can't pass my env variables to the Tox environment before it runs the deps installation command. I already tried using setenv and passenv, but both passes the env variables to the…
FirEc00l
  • 41
  • 4
4
votes
1 answer

How to run tests with tox.ini

I am reading and trying to understand some libraries online, and I come across the following: Tests with no pytest or unitest I am reading online and I found a tox.ini file like the following: [tox] envlist = py27 py35 py36 py37 …
may
  • 1,073
  • 4
  • 14
  • 31
4
votes
2 answers

How can I make test data files accessible to pytest tests when run with tox?

I want to run a test for a function which accepts a Path to a file as input via an argument: function(some_path_to_file) via tox. The file I want to pass to the function cannot be created temporarily during test setup (what I usually do via pytests…
thinwybk
  • 4,193
  • 2
  • 40
  • 76
4
votes
3 answers

Use own package in tox+pytest

I have python application which I would like to test. This application is importing a lot of packages for example: import time import sys . . . import mypackage Where mypackage is my own package. When I start application everything works fine.…
4
votes
4 answers

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

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…
Viral Modi
  • 1,957
  • 1
  • 9
  • 18
4
votes
1 answer

How can I combine coverage results with tox?

For my mpu package I have execution-environment dependend code like if sys.version_info < (3, 0): pass # do something else: pass # do something else and a tox file [tox] envlist = py27,py36 [testenv] deps = pytest pytest-cov …
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
4
votes
2 answers

Failure to uninstall a python package from a pypy virtualenv on windows in develop mode

TL;DR: Running python setup.py develop --uninstall from a pypy environment created using tox results in an exception: error: [Error 32] The process cannot access the file because it is being used by another process:…
4
votes
2 answers

Python tox and py.test: how to run just a single test rather than the whole test suite

I'm new to Django and testing so please bear with me. Trying to run on the terminal a new test for code I developed in a Django project, but unfortunatly I inherited several test failures (already confirmed that by analyzing commits prior to mine).…
Vini.g.fer
  • 11,639
  • 16
  • 61
  • 90
4
votes
0 answers

Can I have multiple minor versions of python as well with pyenv and tox

I installed python 2.6.9, 2.7.10, 2.7.11, 2.7.12 with Pyenv, but when I check ~/.pyenv/shims/, it has only one python2.7 which points to 2.7.10. My system has python 2.7.13 installed. When I use tox to use py2710, py2711, py2712, it uses system's…
abhijitjaiswal
  • 139
  • 1
  • 8
4
votes
1 answer

How to create tox.ini variables

Is there a way to set arbitrary variables within tox.ini? An example would be a project name that might be used in a variety of ways. With a rather complex tox.ini, I find myself copy and pasting all over where I should just need to set a variable…
Brian Bruggeman
  • 5,008
  • 2
  • 36
  • 55