tests: rename report_test to testreport so that pytest doesn't think it is a testcase

pull/317/merge
matejcik 4 years ago committed by matejcik
parent aeaa402b75
commit 17c4d75b40

@ -25,7 +25,7 @@ from trezorlib.transport import enumerate_devices, get_transport
from . import ui_tests
from .device_handler import BackgroundDeviceHandler
from .ui_tests.reporting import report_test
from .ui_tests.reporting import testreport
def get_device():
@ -149,7 +149,7 @@ def client(request):
def pytest_sessionstart(session):
ui_tests.read_fixtures()
if session.config.getoption("ui") == "test":
report_test.clear_dir()
testreport.clear_dir()
def _should_write_ui_report(exitstatus):
@ -166,7 +166,7 @@ def pytest_sessionfinish(session, exitstatus):
if session.config.getoption("ui") == "test":
if session.config.getoption("ui_check_missing") and ui_tests.list_missing():
session.exitstatus = pytest.ExitCode.TESTS_FAILED
report_test.index()
testreport.index()
if session.config.getoption("ui") == "record":
ui_tests.write_fixtures(session.config.getoption("ui_check_missing"))
@ -191,7 +191,7 @@ def pytest_terminal_summary(terminalreporter, exitstatus, config):
println()
if _should_write_ui_report(exitstatus):
println(f"UI tests summary: {report_test.REPORTS_PATH / 'index.html'}")
println(f"UI tests summary: {testreport.REPORTS_PATH / 'index.html'}")
def pytest_addoption(parser):

@ -7,7 +7,7 @@ from pathlib import Path
import pytest
from .reporting import report_test
from .reporting import testreport
UI_TESTS_DIR = Path(__file__).parent.resolve()
HASH_FILE = UI_TESTS_DIR / "fixtures.json"
@ -61,7 +61,7 @@ def _process_tested(fixture_test_path, test_name):
_rename_records(actual_path)
if actual_hash != expected_hash:
file_path = report_test.failed(
file_path = testreport.failed(
fixture_test_path, test_name, actual_hash, expected_hash
)
@ -71,7 +71,7 @@ def _process_tested(fixture_test_path, test_name):
)
)
else:
report_test.passed(fixture_test_path, test_name, actual_hash)
testreport.passed(fixture_test_path, test_name, actual_hash)
@contextmanager

Loading…
Cancel
Save