summaryrefslogtreecommitdiffstats
path: root/conftest.py
diff options
context:
space:
mode:
authorEdi Feschiyan <efeschiyan@pm.me>2020-08-07 17:38:56 +0300
committerEdi Feschiyan <efeschiyan@pm.me>2020-08-07 17:38:56 +0300
commita4001b62acb0e267183d87ecf891a265b17c7018 (patch)
tree7765089fb5178f555d6abb263c6ebb3f4da6cbfd /conftest.py
parent14ee65e5f4892ab36e2b884e4384f11a474e67e2 (diff)
moving conftest conftest under a package
Diffstat (limited to 'conftest.py')
-rw-r--r--conftest.py32
1 files changed, 0 insertions, 32 deletions
diff --git a/conftest.py b/conftest.py
deleted file mode 100644
index 2176354..0000000
--- a/conftest.py
+++ /dev/null
@@ -1,32 +0,0 @@
-import pytest
-
-
-def pytest_addoption(parser):
- parser.addoption('-L', '--lava', action='store_true', help='enable LAVA signals')
-
-
-def lava_result_convert(pytest_outcome):
- """ Convert the pytestoutcome to the string expected by LAVA."""
- if pytest_outcome == 'passed':
- return 'pass'
- elif pytest_outcome == 'skipped':
- return 'pass'
- elif pytest_outcome == 'xfailed':
- return 'pass'
- else:
- return'fail'
-
-
-def pytest_report_teststatus(config, report):
- """ Insert strings that LAVA expects to capture test results."""
-# Get pytest test name and remove the 'test_' prefix
- if config.getoption('--lava'):
- test_name = report.location[2][5:]
- if report.when == 'setup':
- print('\n')
- print(f'<LAVA_SIGNAL_STARTTC {test_name}>')
- elif report.when == 'call':
- test_result = lava_result_convert(report.outcome)
- print('\n')
- print(f'<LAVA_SIGNAL_ENDTC {test_name}>')
- print(f'<LAVA_SIGNAL_TESTCASE TEST_CASE_ID={test_name} RESULT={test_result}>')