[Pytest-commit] Issue #143: projects with setup.py as tox test fixtures (hpk42/tox)

faassen issues-reply at bitbucket.org
Wed Jan 8 16:58:38 CET 2014


New issue 143: projects with setup.py as tox test fixtures
https://bitbucket.org/hpk42/tox/issue/143/projects-with-setuppy-as-tox-test-fixtures

faassen:

I have code that needs Python projects with a setup.py as test fixtures. This is because I'm testing code that inspects their requirements using pkg_resources. The actual code in the test fixtures is not so important, though features in my test too, as that code if important if certain conditions hold true about the requirements.

It makes no sense to publish these test fixture projects on pypi or any other package index: they're just test fixtures, after all.

With buildout I can simply point to the fixture's project directory (with the setup.py in it) and it will make sure that project is installed. With tox I don't see a way how to do this.

This blocks me from using tox in my project (Morepath). I wanted to use tox as a tool to help me make sure it runs with PyPy and Python 3; without tox this is much more cumbersome.

I'll note that having the ability to install directories as projects would also help with a previous use case I had: I wanted to run tox-based tests without having to publish the code of a dependent library on a package index.

Here's a buildout-inspired possible way to configure this. Add something like this to tox.ini:

```
develop = fixtures/test_package
                my_dependency_under_development
```

tox can then look in those listed directories, which are presumed to have a setup.py, and install them into the test environment. for those packages tox won't go off and try to download them from an index.

If the situation occurs that the requirements don't match, i.e. the develop package has dependency 0.1 and another setup.py tries to pull in dependency 0.2, perhaps we should fail loudly instead of silently downloading dependency 0.2 and letting the user believe their local directory is under test.



[develop 




More information about the pytest-commit mailing list