diff options
-rw-r--r-- | cherrypy/test/test_states.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/cherrypy/test/test_states.py b/cherrypy/test/test_states.py index 2179de33..ca2949e9 100644 --- a/cherrypy/test/test_states.py +++ b/cherrypy/test/test_states.py @@ -10,6 +10,10 @@ import cherrypy import cherrypy.process.servers from cherrypy.test import helper + +IS_WINDOWS = os.name == 'nt' + + engine = cherrypy.engine thisdir = os.path.join(os.getcwd(), os.path.dirname(__file__)) @@ -161,7 +165,7 @@ class ServerStateTests(helper.CPWebCase): self.assertEqual(db_connection.running, False) self.assertEqual(len(db_connection.threads), 0) - @pytest.mark.xfail(reason='KeyboardInterrupt #1873', run=(os.name != 'nt')) + @pytest.mark.xfail(reason='KeyboardInterrupt #1873', run=not IS_WINDOWS) def test_2_KeyboardInterrupt(self): # Raise a keyboard interrupt in the HTTP server's main thread. # We must start the server in this, the main thread @@ -220,6 +224,9 @@ class ServerStateTests(helper.CPWebCase): self.assertEqual(db_connection.running, False) self.assertEqual(len(db_connection.threads), 0) + if not IS_WINDOWS: + test_2_KeyboardInterrupt = pytest.mark.forked(test_2_KeyboardInterrupt) + @pytest.mark.xfail( 'sys.platform == "Darwin" ' 'and sys.version_info > (3, 7) ' |