From af923e261bacbaf0bfb4be77a57d3604cf7e9291 Mon Sep 17 00:00:00 2001 From: enkore Date: Sat, 17 Dec 2016 15:23:47 +0100 Subject: [PATCH] conftest: pytest 2 compat --- conftest.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/conftest.py b/conftest.py index 197af6fd1..596a4b21f 100644 --- a/conftest.py +++ b/conftest.py @@ -5,7 +5,8 @@ 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