Overview
NoseMultiVersion is a Nose plugin to run tests simultaneously in different versions of Python.
When the plugin is activated, your test suite spawns off subprocesses to run the same tests in each Python interpreter then the results are printed in the main process. It was designed for libraries or applications that want to support legacy versions of Python or for projects that need to work in virtual environments that are configured differently. Because it uses sockets via execnet and parallel subprocesses, it only adds minimal overhead to your test time.
Installation
NoseMultiVersion, Nose, and execnet must be installed in each version of Python you want to run your tests in. Your test and application modules do not need to be installed in each Python version.
Here’s how to install the NoseMultiVersion and its dependencies:
Install With Pip From Source
Grab the pip source and do something like this:
$ cd /pip/source $ sudo python2.4 ./scripts/pip install -e hg+http://bitbucket.org/kumar303/nose-multiversion/#egg=NoseMultiVersion $ sudo python2.5 ./scripts/pip install -e hg+http://bitbucket.org/kumar303/nose-multiversion/#egg=NoseMultiVersion $ sudo python2.6 ./scripts/pip install -e hg+http://bitbucket.org/kumar303/nose-multiversion/#egg=NoseMultiVersion
Install With Pip From PyPI
Just like above but do:
$ cd /pip/source $ sudo python2.4 ./scripts/pip install NoseMultiVersion $ sudo python2.5 ./scripts/pip install NoseMultiVersion $ sudo python2.6 ./scripts/pip install NoseMultiVersion
Install With Setuptools
$ sudo easy_install-2.4 http://bitbucket.org/kumar303/nose-multiversion/get/tip.zip $ sudo easy_install-2.5 http://bitbucket.org/kumar303/nose-multiversion/get/tip.zip $ sudo easy_install-2.6 http://bitbucket.org/kumar303/nose-multiversion/get/tip.zip
Run A Simple Test Suite In Multiple Versions of Python
If you have an application without many dependencies you can probably just run the tests in multiple versions like this:
$ cd /your/test/suite $ nosetests --in-python=2.4,2.5,2.6
Run A Complex Test Suite In A Virtualenv
It’s most likely that your application has some dependencies that you are probably managing with a custom virtualenv. The value passed to the --in-python= option can also be an absolute path to a Python interpreter so set up your virtualenv directories then run your tests like this:
$ cd /your/test/suite $ nosetests --in-python=/path/to/a/virtualenv-for-2.5/bin/python --in-python=/path/to/a/virtualenv-for-2.6/bin/python
Declare Option Values in a Config Script
As with any Nose option, you can use a config file to set its value, like this:
[nosetests]
in-python=
/path/to/your-virtualenv1/bin/python
/path/to/your-virtualenv2/bin/python
/path/to/jython
/path/to/your-custom-build/bin/python
Acknowledgements
This plugin was created by Kumar McMillan <kumar.mcmillan@gmail.com>. Big thanks to Holger Krekel for extracting execnet into its own package. This allowed Nose to steal a nice feature from py.test :)
Bugs, Patches
Submit all bugs and patches to http://bitbucket.org/kumar303/nose-multiversion/ – thanks!
Random Notes
If another plugin tries to do a frame hack then it might break because tracebacks and frames are flattened then pickled so they can be sent from a worker to the main process.
When Nose supports Python 3.0 as well as execnet then adding 3.0 to your options should just magically work!
There are probably some other nifty things to steal from py.test like decorators that raise Nose’s SkipTest exception when you don’t want to run a test in a specific version.
Metadata
Release files for NoseMultiVersion 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| NoseMultiVersion-0.1.tar.gz | 5.7 kB | Without provenance | Details for NoseMultiVersion-0.1.tar.gz |
Release files / NoseMultiVersion-0.1.tar.gz
| Download URL | NoseMultiVersion-0.1.tar.gz |
|---|---|
| Size | 5.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
346308aecb6a0543715265831e7976b705d2577de291c4da23062cfa8fd38a2e
|
|
BLAKE2b-256 checksum How to use checksums |
e77e6190c2000097e63e0327610d66f3d7319ac027f559802997ff0b1ec6f53a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for NoseMultiVersion 0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.