Skip running test_2_KeyboardInterrupt with xfail
This change completely skipps the test because neither using
pytest-forked, nor using just `xfail` with `raises` seems to
be able to isolate the failure without affecting the whole
test suite run.
@@ -11,9 +11,6 @@ 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__))
@@ -165,7 +162,10 @@ class ServerStateTests(helper.CPWebCase):
self.assertEqual(db_connection.running, False)
self.assertEqual(len(db_connection.threads), 0)
- @pytest.mark.xfail(reason='KeyboardInterrupt #1873', run=not IS_WINDOWS)
+ @pytest.mark.xfail(
+ raises=KeyboardInterrupt, reason='KeyboardInterrupt #1873',
+ run=False,
+ )
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
@@ -224,9 +224,6 @@ 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) '
