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 12
12
import types
13
13
14
14
import pytest
15
- from pkg_resources import parse_version
16
15
17
16
from .django_compat import is_django_unittest # noqa
18
17
from .fixtures import django_assert_num_queries # noqa
53
52
PY2 = sys .version_info [0 ] == 2
54
53
55
54
# 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 )
57
57
58
58
_report_header = []
59
59
Original file line number Diff line number Diff line change 1
1
import pytest
2
2
from django .test import TestCase
3
- from pkg_resources import parse_version
4
3
4
+ from pytest_django .plugin import _pytest_version_info
5
5
from pytest_django_test .app .models import Item
6
6
7
7
@@ -146,7 +146,7 @@ def test_pass(self):
146
146
expected_lines = [
147
147
"* ERROR at setup of TestFoo.test_pass *" ,
148
148
]
149
- if parse_version ( pytest . __version__ ) < parse_version ( "4.2" ):
149
+ if _pytest_version_info < ( 4 , 2 ):
150
150
expected_lines += [
151
151
"E *Failed: <class 'tpkg.test_the_test.TestFoo'>.setUpClass should be a classmethod" , # noqa:E501
152
152
]
You can’t perform that action at this time.
0 commit comments