Commits

Allan Crooks  committed b8ad779

Update test_states so some tests can run in isolation without requiring side-effects from sibling tests. Fixes #1197.

  • Participants
  • Parent commits abdfa65

Comments (0)

Files changed (1)

File cherrypy/test/test_states.py

             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"')
         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'),