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
0
votes
2 answers

Capture just version from tox commands

I have following in my tox.ini : [tox] skipsdist = true envlist = py27, py36, lint [testenv] whitelist_externals=flake8 commands = version: python setup.py --version When I run tox -e version I get the following output : tox -e version…
Scooby
  • 3,371
  • 8
  • 44
  • 84
0
votes
1 answer

SWIG, Python and unicode strings

I am developing a Python module using SWIG and linking with a certain library. I have a typemap like the following: %typemap(in) MyStringType { char* buffer = 0; size_t size = 0; int alloc = SWIG_OLDOBJ; int res =…
Ratmil
  • 117
  • 8
0
votes
1 answer

Can't Install Tox

I am using MacOs Sierra 10.12.6 , when I want to install Tox (https://tox.readthedocs.io/en/latest/install.html ) . ~ $ pip install tox Collecting tox Could not fetch URL https://pypi.python.org/simple/tox/: There was a problem confirming the ssl…
mevaka
  • 1,980
  • 2
  • 17
  • 24
0
votes
1 answer

Running tox on all interpreters including wide and narrow 2.7 compiled Python

ruamel.yaml has a regression, introduced with a merged PR, that changed code that has essentially different paths for Python versions compiled with wide and narrow Unicode characters. The regression was not found during the pre-build/commit…
Anthon
  • 69,918
  • 32
  • 186
  • 246
0
votes
1 answer

Export pytest results even when AssertionError

I have a tox file which run pytest on my project and export test results when all of them passed but when one of them failed, and I get an AssertionError, I can not save my logs in my results file. Have you any idea or solution to save logs even…
Axel Bayle
  • 205
  • 1
  • 2
  • 8
0
votes
1 answer

Docker ENTRYPOINT doesn't execute command/ tox

Can anyone could give me a clue why I am not able run a command in ENTRYPOINT. My Docker file looks like ..... ..... ENTRYPOINT ["bash -c tox -e docker-server"] But when I do Dcoker run, I get this error Docker: Error response from daemon: OCI…
Fact
  • 1,957
  • 1
  • 17
  • 26
0
votes
1 answer

Has anyone tried integrating Tox and SCL on Centos6/7?

I use CENTOS 6/7 for my development and I was wondering if anyone had some success integrating TOX, setuptools and SCL version of python: rh-python34, rh-python35 and rh-python36? There isn't much info on the web regarding this topic? Thanks
user465374
  • 1,521
  • 4
  • 20
  • 39
0
votes
1 answer

why am i getting a tox import error before the dependencies are installed

in my django project, I have a an __init__.py file that imports celery, I suspect this may be causing tox to complain. /testproj/testproj/ ____init___.py from .celery import app as celery_app when I run tox, the tests successfully run, but I see…
david
  • 6,303
  • 16
  • 54
  • 91
0
votes
1 answer

How can I write a unit test for a Docker container with Flask web service?

I have a Flask web service inside a Docker container. What I currently do: $ docker run -p 8080:8080 --rm my_image serve.py $ curl -d '{"foo": "bar", "foo2": "bar2"}' -H "Content-Type: application/json" -v http://localhost:8080/ping If that returns…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
0
votes
1 answer

How can I make tox run in a clean environment?

Once in a while I run tox, everything works, but when somebody else downloads the repository it doesn't because I forgot to commit something. I like tox because it prevents me from forgetting to add requirements to setup.py. Can I make it also run…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
0
votes
1 answer

Is it possible to allow multiple testenv labels with the same script?

Currently we have multiple toxenv that's just a simple copy+paste code: https://github.com/nltk/nltk/blob/alvations-test-tox/tox.ini [testenv:py2.7.14-jenkins] basepython = python commands = {toxinidir}/jenkins.sh setenv = STANFORD_MODELS =…
alvas
  • 115,346
  • 109
  • 446
  • 738
0
votes
1 answer

How do I test for speed with PyTest / tox?

For testing machine learning algorithms / repositories, I see three things that matter: Does it crash Does it have a minimum test accuracy Is it fast enough While (1) and maybe (2) is standard unit testing, I'm not too sure how to deal with (3).…
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
0
votes
1 answer

How can I install xgboost for tox?

XGBoost needs to be compiled. For Docker, I install it like this: RUN git clone --recursive https://github.com/dmlc/xgboost.git WORKDIR xgboost RUN ./build.sh && pip3 install -e python-package How can I make sure it is available for tox?
Martin Thoma
  • 124,992
  • 159
  • 614
  • 958
0
votes
0 answers

"file not found" on travis-ci when running pytest from tox using docker

I'm trying to run my tests throught travis-ci, but i receive "file not found tests" error. When i run local with same command everything is ok, but in travis i receive this error. I think its because tests folder which in root of my project located…
Vova
  • 580
  • 3
  • 7
  • 20
0
votes
2 answers

Set environment variable in tox that deps require

One of the required Python package needs to be compiled with having a specific environment variable set. I looked at tox documentation either PASSENV or setenv only impacts the execution of tests commands. What can I do? Anything I misunderstand?…
Chenxiong Qi
  • 416
  • 3
  • 8