Browse Source

pytest 2 compat

enkore 9 năm trước cách đây
mục cha
commit
0c959cb67a
1 tập tin đã thay đổi với 2 bổ sung1 xóa
  1. 2 1
      conftest.py

+ 2 - 1
conftest.py

@@ -3,7 +3,8 @@ import os
 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')
 
 from borg.logger import setup_logging