Răsfoiți Sursa

conftest: pytest 2 compat

enkore 8 ani în urmă
părinte
comite
af923e261b
1 a modificat fișierele cu 2 adăugiri și 1 ștergeri
  1. 2 1
      conftest.py

+ 2 - 1
conftest.py

@@ -5,7 +5,8 @@ import sys
 import pytest
 
 # needed to get pretty assertion failures in unit tests:
-pytest.register_assert_rewrite('borg.testsuite')
+if hasattr(pytest, 'register_assert_rewrite'):
+    pytest.register_assert_rewrite('borg.testsuite')
 
 # This is a hack to fix path problems because "borg" (the package) is in the source root.
 # When importing the conftest an "import borg" can incorrectly import the borg from the