summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAllan Crooks <allan@amcone.net>2014-04-16 01:49:02 -0400
committerAllan Crooks <allan@amcone.net>2014-04-16 01:49:02 -0400
commit126ae73ad7052f39a4a48afcf36189ac5a18ae9d (patch)
tree9dca4f61e62ea209378271d464cbedac063cc796
parent4236f7287f63e19a9cb71367b2e57ac04067b6bd (diff)
downloadcherrypy-126ae73ad7052f39a4a48afcf36189ac5a18ae9d.tar.gz
Update test_states so some tests can run in isolation without requiring side-effects from sibling tests. Fixes #1197.
-rw-r--r--cherrypy/test/test_states.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/cherrypy/test/test_states.py b/cherrypy/test/test_states.py
index d62f0085..b94880e2 100644
--- a/cherrypy/test/test_states.py
+++ b/cherrypy/test/test_states.py
@@ -249,6 +249,11 @@ class ServerStateTests(helper.CPWebCase):
engine.exit()
def test_4_Autoreload(self):
+ # If test_3 has not been executed, the server won't be stopped,
+ # so we'll have to do it.
+ if engine.state != engine.states.EXITING:
+ engine.exit()
+
# Start the demo script in a new process
p = helper.CPProcess(ssl=(self.scheme.lower() == 'https'))
p.write_conf(extra='test_case_name: "test_4_Autoreload"')
@@ -279,6 +284,11 @@ class ServerStateTests(helper.CPWebCase):
p.join()
def test_5_Start_Error(self):
+ # If test_3 has not been executed, the server won't be stopped,
+ # so we'll have to do it.
+ if engine.state != engine.states.EXITING:
+ engine.exit()
+
# If a process errors during start, it should stop the engine
# and exit with a non-zero exit code.
p = helper.CPProcess(ssl=(self.scheme.lower() == 'https'),