summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--testing/tests/benchmarks/conftest.py17
1 files changed, 9 insertions, 8 deletions
diff --git a/testing/tests/benchmarks/conftest.py b/testing/tests/benchmarks/conftest.py
index 377fc606..80eccb08 100644
--- a/testing/tests/benchmarks/conftest.py
+++ b/testing/tests/benchmarks/conftest.py
@@ -9,19 +9,12 @@ import time
from twisted.internet import threads, reactor
-# we have to manually setup the events server in order to be able to signal
-# events. This is usually done by the enclosing application using soledad
-# client (i.e. bitmask client).
-from leap.common.events import server
-server.ensure_server()
-
-
#
# pytest customizations
#
# mark benchmark tests using their group names (thanks ionelmc! :)
-def pytest_collection_modifyitems(items):
+def pytest_collection_modifyitems(items, config):
for item in items:
bench = item.get_marker("benchmark")
if bench and bench.kwargs.get('group'):
@@ -29,6 +22,14 @@ def pytest_collection_modifyitems(items):
marker = getattr(pytest.mark, 'benchmark_' + group)
item.add_marker(marker)
+ subdir = config.getoption('subdir')
+ if subdir == 'benchmarks':
+ # we have to manually setup the events server in order to be able to
+ # signal events. This is usually done by the enclosing application
+ # using soledad client (i.e. bitmask client).
+ from leap.common.events import server
+ server.ensure_server()
+
#
# benchmark fixtures