From f4233fde398172d8734dfae036b71367e274c0fd Mon Sep 17 00:00:00 2001 From: Heikki Linnakangas Date: Wed, 20 Jul 2022 15:19:46 +0300 Subject: [PATCH] Silence "Module already imported" warning in python tests We were getting a warning like this from the pg_regress tests: =================== warnings summary =================== /usr/lib/python3/dist-packages/_pytest/config/__init__.py:663 /usr/lib/python3/dist-packages/_pytest/config/__init__.py:663: PytestAssertRewriteWarning: Module already imported so cannot be rewritten: fixtures.pg_stats self.import_plugin(import_spec) -- Docs: https://docs.pytest.org/en/stable/warnings.html ------------------ Benchmark results ------------------- To fix, reorder the imports in conftest.py. I'm not sure what exactly the problem was or why the order matters, but the warning is gone and that's good enough for me. --- test_runner/conftest.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/test_runner/conftest.py b/test_runner/conftest.py index c6e6289a5c..51545d0217 100644 --- a/test_runner/conftest.py +++ b/test_runner/conftest.py @@ -1,5 +1,5 @@ pytest_plugins = ("fixtures.neon_fixtures", "fixtures.benchmark_fixture", + "fixtures.pg_stats", "fixtures.compare_fixtures", - "fixtures.slow", - "fixtures.pg_stats") + "fixtures.slow")