diff options
author | Ned Batchelder <ned@nedbatchelder.com> | 2012-07-09 22:34:59 -0400 |
---|---|---|
committer | Ned Batchelder <ned@nedbatchelder.com> | 2012-07-09 22:34:59 -0400 |
commit | 5cbd4a4910110021b5ea9693447163f75f4b1953 (patch) | |
tree | 799e8a9d67e5ef82a3374cbe7a06e50a684e48b9 | |
parent | afb29fd79ca4275bbd427ba5c1a0633dec0ae21d (diff) | |
download | python-coveragepy-git-5cbd4a4910110021b5ea9693447163f75f4b1953.tar.gz |
A crude Python script to make all tox commands runnable from the virtualenv.
-rw-r--r-- | servant.py | 19 | ||||
-rw-r--r-- | tox.ini | 11 |
2 files changed, 25 insertions, 5 deletions
diff --git a/servant.py b/servant.py new file mode 100644 index 00000000..33c0d904 --- /dev/null +++ b/servant.py @@ -0,0 +1,19 @@ +import os +import sys +import zipfile + +from nose import core as nose_core + +if sys.argv[1] == "remove_extension": + try: + os.remove("coverage/tracer.so") + except OSError: + pass + +elif sys.argv[1] == "test_with_tracer": + os.environ["COVERAGE_TEST_TRACER"] = sys.argv[2] + del sys.argv[1:3] + nose_core.main() + +elif sys.argv[1] == "zip_mods": + zipfile.ZipFile("test/zipmods.zip", "w").write("test/covmodzip1.py", "covmodzip1.py") @@ -4,7 +4,7 @@ # and then run "tox" from this directory. [tox] -envlist = py24, py25, py26, py27, py32, py33, pypy +envlist = py24, py25, py26, py27, py31, py32, py33, pypy [testenv] setenv = PYTHONPATH=test/eggsrc @@ -13,15 +13,16 @@ commands = {envpython} setup.py develop # Create test/zipmods.zip - make testdata + {envpython} servant.py zip_mods # Remove tracer.so so that we can test the PyTracer - rm {toxinidir}/coverage/tracer.so + {envpython} servant.py remove_extension # Test with the PyTracer - env COVERAGE_TEST_TRACER="py" nosetests -w {toxinidir} + {envpython} servant.py test_with_tracer py # Build tracer.so and test with the CTracer {envpython} setup.py build_ext --inplace - env COVERAGE_TEST_TRACER="c" nosetests -w {toxinidir} + {envpython} servant.py test_with_tracer c + deps = nose |