conftest.py 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. import os
  2. from borg.logger import setup_logging
  3. # Ensure that the loggers exist for all tests
  4. setup_logging()
  5. from borg.testsuite import has_lchflags, has_llfuse
  6. from borg.testsuite import are_symlinks_supported, are_hardlinks_supported, is_utime_fully_supported
  7. from borg.testsuite.platform import fakeroot_detected, are_acls_working
  8. from borg import xattr, constants
  9. def pytest_configure(config):
  10. # no fixture-based monkey-patching since star-imports are used for the constants module
  11. constants.PBKDF2_ITERATIONS = 1
  12. def pytest_report_header(config, startdir):
  13. tests = {
  14. "BSD flags": has_lchflags,
  15. "fuse": has_llfuse,
  16. "root": not fakeroot_detected(),
  17. "symlinks": are_symlinks_supported(),
  18. "hardlinks": are_hardlinks_supported(),
  19. "atime/mtime": is_utime_fully_supported(),
  20. "modes": "BORG_TESTS_IGNORE_MODES" not in os.environ
  21. }
  22. enabled = []
  23. disabled = []
  24. for test in tests:
  25. if tests[test]:
  26. enabled.append(test)
  27. else:
  28. disabled.append(test)
  29. output = "Tests enabled: " + ", ".join(enabled) + "\n"
  30. output += "Tests disabled: " + ", ".join(disabled)
  31. return output