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/")
+    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/", "w").write("test/", "")
 # and then run "tox" from this directory.
-envlist = py24, py25, py26, py27, py32, py33, pypy
+envlist = py24, py25, py26, py27, py31, py32, py33, pypy
 setenv = PYTHONPATH=test/eggsrc
     {envpython} develop
     # Create test/
-    make testdata
+    {envpython} zip_mods
     # Remove so that we can test the PyTracer
-    rm {toxinidir}/coverage/
+    {envpython} remove_extension
     # Test with the PyTracer
-    env COVERAGE_TEST_TRACER="py" nosetests -w {toxinidir}
+    {envpython} test_with_tracer py
     # Build and test with the CTracer
     {envpython} build_ext --inplace
-    env COVERAGE_TEST_TRACER="c" nosetests -w {toxinidir}
+    {envpython} 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
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.