From 450375167ee7dbd705a1d822f53471f29c73dcb4 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 12 Oct 2024 18:01:41 +0200 Subject: [PATCH 1/2] call register_assert_rewrite before importing borg.testsuite --- src/borg/testsuite/conftest.py | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/borg/testsuite/conftest.py b/src/borg/testsuite/conftest.py index 5e6b9c92d..affd317ce 100644 --- a/src/borg/testsuite/conftest.py +++ b/src/borg/testsuite/conftest.py @@ -3,20 +3,18 @@ import pytest -from borg.testsuite.archiver import BORG_EXES - if hasattr(pytest, "register_assert_rewrite"): pytest.register_assert_rewrite("borg.testsuite") - -from borg.archiver import Archiver # noqa: E402 +# Ensure that the loggers exist for all tests from borg.logger import setup_logging # noqa: E402 -# Ensure that the loggers exist for all tests setup_logging() +from borg.archiver import Archiver # noqa: E402 from borg.testsuite import has_lchflags, has_llfuse, has_pyfuse3 # noqa: E402 from borg.testsuite import are_symlinks_supported, are_hardlinks_supported, is_utime_fully_supported # noqa: E402 +from borg.testsuite.archiver import BORG_EXES from borg.testsuite.platform_test import fakeroot_detected # noqa: E402 From 2b06ac50a191ec1ece17e194540da7bd1fb41491 Mon Sep 17 00:00:00 2001 From: Thomas Waldmann Date: Sat, 12 Oct 2024 18:26:48 +0200 Subject: [PATCH 2/2] move conftest one level higher if it is inside borg.testsuite, we can't rewrite asserts in there. --- src/borg/{testsuite => }/conftest.py | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename src/borg/{testsuite => }/conftest.py (100%) diff --git a/src/borg/testsuite/conftest.py b/src/borg/conftest.py similarity index 100% rename from src/borg/testsuite/conftest.py rename to src/borg/conftest.py