-
Notifications
You must be signed in to change notification settings - Fork 57
Closed
Description
Simply the presence of flaky plugin will prevent Ctrl+C from stopping the test suite. Flaky will register the KeyboardInterrupt as a test failure -- as opposed to pure pytest, which will stop the test suite.
Version information is in the test log below.
with flaky:
$ pytest
============================= test session starts ==============================
platform linux -- Python 3.6.8, pytest-5.0.1, py-1.7.0, pluggy-0.12.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/matejcik/a/.hypothesis/examples')
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
rootdir: /home/matejcik/a
plugins: hypothesis-4.4.3, random-order-1.0.4, cov-2.7.1, asyncio-0.10.0, flaky-3.6.0
collected 1 item
test_pytest.py ^CF [100%]
=================================== FAILURES ===================================
___________________________________ test_foo ___________________________________
def test_foo():
> time.sleep(10)
E KeyboardInterrupt
test_pytest.py:4: KeyboardInterrupt
=========================== 1 failed in 0.80 seconds ===========================
without flaky:
$ pytest -p no:flaky
============================================================ test session starts ============================================================
platform linux -- Python 3.6.8, pytest-5.0.1, py-1.7.0, pluggy-0.12.0
hypothesis profile 'default' -> database=DirectoryBasedExampleDatabase('/home/matejcik/a/.hypothesis/examples')
Test order randomisation NOT enabled. Enable with --random-order or --random-order-bucket=<bucket_type>
rootdir: /home/matejcik/a
plugins: hypothesis-4.4.3, random-order-1.0.4, cov-2.7.1, asyncio-0.10.0
collected 1 item
test_pytest.py ^C
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! KeyboardInterrupt !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
/home/matejcik/a/test_pytest.py:4: KeyboardInterrupt
(to show a full traceback on KeyboardInterrupt use --fulltrace)
======================================================= no tests ran in 1.94 seconds ========================================================
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels