summaryrefslogtreecommitdiffhomepage
path: root/test/conftest.py
diff options
context:
space:
mode:
authorAndrei Zeliankou <zelenkov@nginx.com>2020-12-06 16:01:59 +0000
committerAndrei Zeliankou <zelenkov@nginx.com>2020-12-06 16:01:59 +0000
commit07789a23e9c513dba87b020fae2989a57955e8a6 (patch)
treeaa5b77497ee957b79a67f70df796c0da49447a22 /test/conftest.py
parent55296e6ff2613a0b2ec588beaf01620b2679c3d1 (diff)
downloadunit-07789a23e9c513dba87b020fae2989a57955e8a6.tar.gz
unit-07789a23e9c513dba87b020fae2989a57955e8a6.tar.bz2
Tests: options moved to the separate class.
This change is necessary to separate the logic and prevent possible circular dependency.
Diffstat (limited to '')
-rw-r--r--test/conftest.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/test/conftest.py b/test/conftest.py
index 3edc471d..8ca8c1d3 100644
--- a/test/conftest.py
+++ b/test/conftest.py
@@ -17,6 +17,7 @@ import pytest
from unit.check.go import check_go
from unit.check.node import check_node
from unit.check.tls import check_openssl
+from unit.option import option
def pytest_addoption(parser):
@@ -48,12 +49,14 @@ def pytest_addoption(parser):
unit_instance = {}
_processes = []
-option = None
-
def pytest_configure(config):
- global option
- option = config.option
+ option.config = config.option
+
+ option.detailed = config.option.detailed
+ option.print_log = config.option.print_log
+ option.save_log = config.option.save_log
+ option.unsafe = config.option.unsafe
option.generated_tests = {}
option.current_dir = os.path.abspath(
@@ -162,6 +165,8 @@ def pytest_sessionstart(session):
unit_stop()
+ _check_alerts()
+
shutil.rmtree(unit_instance['temp_dir'])