summaryrefslogtreecommitdiff
path: root/testing/tests/responsiveness/conftest.py
diff options
context:
space:
mode:
Diffstat (limited to 'testing/tests/responsiveness/conftest.py')
-rw-r--r--testing/tests/responsiveness/conftest.py22
1 files changed, 22 insertions, 0 deletions
diff --git a/testing/tests/responsiveness/conftest.py b/testing/tests/responsiveness/conftest.py
new file mode 100644
index 00000000..6b2687b1
--- /dev/null
+++ b/testing/tests/responsiveness/conftest.py
@@ -0,0 +1,22 @@
+import pytest
+
+from watchdog import Watchdog
+
+
+def _post_results(dog):
+ print("\n")
+ print("+" * 50)
+ print(dog.seconds_blocked)
+ print("+" * 50)
+
+
+@pytest.fixture
+def watchdog(request):
+ dog = Watchdog()
+ dog_d = dog.start()
+ request.addfinalizer(lambda: _post_results(dog))
+
+ def _run(deferred_fun):
+ deferred_fun().addCallback(lambda _: dog.stop())
+ return dog_d
+ return _run