| 1234567891011121314151617181920212223242526272829303132333435363738 | import osfrom borg.logger import setup_logging# Ensure that the loggers exist for all testssetup_logging()from borg.testsuite import has_lchflags, has_llfusefrom borg.testsuite import are_symlinks_supported, are_hardlinks_supported, is_utime_fully_supportedfrom borg.testsuite.platform import fakeroot_detected, are_acls_workingfrom borg import xattr, constantsdef pytest_configure(config):    # no fixture-based monkey-patching since star-imports are used for the constants module    constants.PBKDF2_ITERATIONS = 1def pytest_report_header(config, startdir):    tests = {        "BSD flags": has_lchflags,        "fuse": has_llfuse,        "root": not fakeroot_detected(),        "symlinks": are_symlinks_supported(),        "hardlinks": are_hardlinks_supported(),        "atime/mtime": is_utime_fully_supported(),        "modes": "BORG_TESTS_IGNORE_MODES" not in os.environ    }    enabled = []    disabled = []    for test in tests:        if tests[test]:            enabled.append(test)        else:            disabled.append(test)    output = "Tests enabled: " + ", ".join(enabled) + "\n"    output += "Tests disabled: " + ", ".join(disabled)    return output
 |