From 17c4d75b406badcef77da8655b8f5e817b1c198a Mon Sep 17 00:00:00 2001 From: matejcik Date: Mon, 11 May 2020 16:23:12 +0200 Subject: [PATCH] tests: rename report_test to testreport so that pytest doesn't think it is a testcase --- tests/conftest.py | 8 ++++---- tests/ui_tests/__init__.py | 6 +++--- .../ui_tests/reporting/{report_test.py => testreport.py} | 0 3 files changed, 7 insertions(+), 7 deletions(-) rename tests/ui_tests/reporting/{report_test.py => testreport.py} (100%) diff --git a/tests/conftest.py b/tests/conftest.py index 86b36402a..9d75a0cf7 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -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): diff --git a/tests/ui_tests/__init__.py b/tests/ui_tests/__init__.py index bbe4f2394..35200a4f3 100644 --- a/tests/ui_tests/__init__.py +++ b/tests/ui_tests/__init__.py @@ -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 diff --git a/tests/ui_tests/reporting/report_test.py b/tests/ui_tests/reporting/testreport.py similarity index 100% rename from tests/ui_tests/reporting/report_test.py rename to tests/ui_tests/reporting/testreport.py