Ned Batchelder avatar Ned Batchelder committed aa0ddef Draft

A crude Python script to make all tox commands runnable from the virtualenv.

Comments (0)

Files changed (2)

+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")
 # 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
     {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
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.