File tree Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Expand file tree Collapse file tree 2 files changed +4
-4
lines changed Original file line number Diff line number Diff line change 1212import types
1313
1414import pytest
15- from pkg_resources import parse_version
1615
1716from .django_compat import is_django_unittest # noqa
1817from .fixtures import django_assert_num_queries # noqa
5352PY2 = sys .version_info [0 ] == 2
5453
5554# pytest 4.2 handles unittest setup/teardown itself via wrapping fixtures.
56- _handle_unittest_methods = parse_version (pytest .__version__ ) < parse_version ("4.2" )
55+ _pytest_version_info = tuple (int (x ) for x in pytest .__version__ .split ("." , 2 )[:2 ])
56+ _handle_unittest_methods = _pytest_version_info < (4 , 2 )
5757
5858_report_header = []
5959
Original file line number Diff line number Diff line change 11import pytest
22from django .test import TestCase
3- from pkg_resources import parse_version
43
4+ from pytest_django .plugin import _pytest_version_info
55from pytest_django_test .app .models import Item
66
77
@@ -146,7 +146,7 @@ def test_pass(self):
146146 expected_lines = [
147147 "* ERROR at setup of TestFoo.test_pass *" ,
148148 ]
149- if parse_version ( pytest . __version__ ) < parse_version ( "4.2" ):
149+ if _pytest_version_info < ( 4 , 2 ):
150150 expected_lines += [
151151 "E *Failed: <class 'tpkg.test_the_test.TestFoo'>.setUpClass should be a classmethod" , # noqa:E501
152152 ]
You can’t perform that action at this time.
0 commit comments