From a4001b62acb0e267183d87ecf891a265b17c7018 Mon Sep 17 00:00:00 2001 From: Edi Feschiyan Date: Fri, 7 Aug 2020 17:38:56 +0300 Subject: moving conftest conftest under a package --- conftest.py | 32 -------------------------------- pyagl/conftest.py | 32 ++++++++++++++++++++++++++++++++ 2 files changed, 32 insertions(+), 32 deletions(-) delete mode 100644 conftest.py create mode 100644 pyagl/conftest.py 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'') - elif report.when == 'call': - test_result = lava_result_convert(report.outcome) - print('\n') - print(f'') - print(f'') diff --git a/pyagl/conftest.py b/pyagl/conftest.py new file mode 100644 index 0000000..2176354 --- /dev/null +++ b/pyagl/conftest.py @@ -0,0 +1,32 @@ +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'') + elif report.when == 'call': + test_result = lava_result_convert(report.outcome) + print('\n') + print(f'') + print(f'') -- cgit 1.2.3-korg