Commits

Marc Abramowitz committed 871eaf4

Add support for tox and testing with both Python 2 and Python 3 without
doing destructive transformations on the source in-place.

Comments (0)

Files changed (3)

 \.coverage
 \.DS_Store
 test.cfg
+^py3/
+^\.tox/
+#!/bin/sh
+
+# Set up a py3 directory with files translated for Python 3
+rm -rf py3
+mkdir py3
+cp -pr lib test examples setup.cfg sqla_nose.py py3/
+python sa2to3.py --no-diffs --write --write-unchanged-files --nobackups py3 > /dev/null 2>&1 | grep -v '^RefactoringTool: py3/'
+
+cd py3
+
+# This prints out the number of tests collected but doesn't run them
+# Useful for debugging the test scripts
+#
+# python sqla_nose.py --collect-only -v 2>&1 | grep '^Ran'
+
+# Run the tests!
+python sqla_nose.py
+# Tox (http://tox.testrun.org/) is a tool for running tests
+# in multiple virtualenvs. This configuration file will run the
+# test suite on all supported python versions. To use it, "pip install tox"
+# and then run "tox" from this directory.
+
+[tox]
+envlist = py25, py26, py27, py32, py33, pypy
+
+[testenv]
+deps =
+    nose
+commands = {envpython} ./sqla_nose.py
+
+[testenv:py32]
+commands =
+    {toxinidir}/test_py3k.sh
+
+[testenv:py33]
+commands =
+    {toxinidir}/test_py3k.sh
+
+# Jython not working yet, because sqla_nose.py wants to use sqlite by default
+# which requires pysqlite for Jython, but you can't install it with Jython,
+# because Jython doesn't support compiling C extensions.
+#
+# [testenv:jython]
+# deps =
+#     {[testenv]deps}
+#     pysqlite