summaryrefslogtreecommitdiff
path: root/py2/cherrypy/test/__init__.py
diff options
context:
space:
mode:
authorRobert Brewer <fumanchu@aminus.org>2011-02-25 22:38:17 +0000
committerRobert Brewer <fumanchu@aminus.org>2011-02-25 22:38:17 +0000
commitfd8b1e2a2662d965f05a14c2c72701decd81697c (patch)
treef6b7f89ffb181bc940c7d9b3541f01f25b49699d /py2/cherrypy/test/__init__.py
parent5450bb603f7e0cf91d216225d3fa3f524710bcd6 (diff)
downloadcherrypy-git-trunk.tar.gz
Bringing python3 back into trunk with its own py3 folder; what was in trunk goes in the py2 folder, and we can use a single setup.py to install either, depending on the version of Python that runs setup.py install.trunk
Diffstat (limited to 'py2/cherrypy/test/__init__.py')
-rw-r--r--py2/cherrypy/test/__init__.py25
1 files changed, 25 insertions, 0 deletions
diff --git a/py2/cherrypy/test/__init__.py b/py2/cherrypy/test/__init__.py
new file mode 100644
index 00000000..e4c400d6
--- /dev/null
+++ b/py2/cherrypy/test/__init__.py
@@ -0,0 +1,25 @@
+"""Regression test suite for CherryPy.
+
+Run 'nosetests -s test/' to exercise all tests.
+
+The '-s' flag instructs nose to output stdout messages, wihch is crucial to
+the 'interactive' mode of webtest.py. If you run these tests without the '-s'
+flag, don't be surprised if the test seems to hang: it's waiting for your
+interactive input.
+"""
+
+import sys
+def newexit():
+ raise SystemExit('Exit called')
+
+def setup():
+ # We want to monkey patch sys.exit so that we can get some
+ # information about where exit is being called.
+ newexit._old = sys.exit
+ sys.exit = newexit
+
+def teardown():
+ try:
+ sys.exit = sys.exit._old
+ except AttributeError:
+ sys.exit = sys._exit