From fb6a6872a0bd5cac7358ac73409e01b04fb20484 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 9 Aug 2017 10:09:29 -0300 Subject: [PATCH] Use pkg_resources to parse the actual pytest version --- testing/acceptance_test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/testing/acceptance_test.py b/testing/acceptance_test.py index 7349273..bc71b8c 100644 --- a/testing/acceptance_test.py +++ b/testing/acceptance_test.py @@ -340,8 +340,10 @@ class TestTerminalReporting: ]) @pytest.mark.parametrize('n', ['-n0', '-n1']) - @pytest.mark.skipif(pytest.__version__ < "3.1", reason='pytest warnings requires >= 3.1') def test_logwarning(self, testdir, n): + from pkg_resources import parse_version + if parse_version(pytest.__version__) < parse_version('3.1'): + pytest.skip('pytest warnings requires >= 3.1') testdir.makepyfile(""" import warnings def test_func():