1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-11-17 21:22:10 +00:00

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

This commit is contained in:
matejcik 2020-05-11 16:23:12 +02:00 committed by matejcik
parent aeaa402b75
commit 17c4d75b40
3 changed files with 7 additions and 7 deletions

View File

@ -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):

View File

@ -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