summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSviatoslav Sydorenko <wk@sydorenko.org.ua>2020-11-17 01:27:07 +0100
committerSviatoslav Sydorenko <wk@sydorenko.org.ua>2020-11-17 01:27:07 +0100
commit0455f78479495b15e78603619345b35917f6c58c (patch)
tree2b865dc227c4adb3161f3eac8cf3bc3a8cdc64fe
parentfdec6497d1f1046d9ed3ecc02d26e56dd1d39638 (diff)
downloadcherrypy-git-0455f78479495b15e78603619345b35917f6c58c.tar.gz
Make test_2_KeyboardInterrupt run in fork @ POSIX
-rw-r--r--cherrypy/test/test_states.py9
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) '