Skip to content

Commit 5979837

Browse files
committed
Import Path from _pytest.pathlib for py35
This is important for `isinstance` checks etc.
1 parent 2fc7d04 commit 5979837

File tree

6 files changed

+6
-6
lines changed

6 files changed

+6
-6
lines changed

src/_pytest/assertion/rewrite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import sys
1414
import tokenize
1515
import types
16-
from pathlib import Path
1716
from typing import Dict
1817
from typing import List
1918
from typing import Optional
@@ -28,6 +27,7 @@
2827
)
2928
from _pytest.compat import fspath
3029
from _pytest.pathlib import fnmatch_ex
30+
from _pytest.pathlib import Path
3131
from _pytest.pathlib import PurePath
3232

3333
# pytest caches rewritten pycs in pycache dirs

src/_pytest/config/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import types
99
import warnings
1010
from functools import lru_cache
11-
from pathlib import Path
1211
from types import TracebackType
1312
from typing import Any
1413
from typing import Callable
@@ -40,6 +39,7 @@
4039
from _pytest.compat import importlib_metadata
4140
from _pytest.outcomes import fail
4241
from _pytest.outcomes import Skipped
42+
from _pytest.pathlib import Path
4343
from _pytest.warning_types import PytestConfigWarning
4444

4545
if False: # TYPE_CHECKING

testing/test_assertrewrite.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@
99
import textwrap
1010
import zipfile
1111
from functools import partial
12-
from pathlib import Path
1312

1413
import py
1514

@@ -23,6 +22,7 @@
2322
from _pytest.assertion.rewrite import PYTEST_TAG
2423
from _pytest.assertion.rewrite import rewrite_asserts
2524
from _pytest.main import ExitCode
25+
from _pytest.pathlib import Path
2626

2727

2828
def setup_module(mod):

testing/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
import os
22
import sys
33
import textwrap
4-
from pathlib import Path
54

65
import _pytest._code
76
import pytest
@@ -13,6 +12,7 @@
1312
from _pytest.config.findpaths import get_common_ancestor
1413
from _pytest.config.findpaths import getcfg
1514
from _pytest.main import ExitCode
15+
from _pytest.pathlib import Path
1616

1717

1818
class TestParseIni:

testing/test_conftest.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
import os
22
import textwrap
3-
from pathlib import Path
43

54
import py
65

76
import pytest
87
from _pytest.config import PytestPluginManager
98
from _pytest.main import ExitCode
9+
from _pytest.pathlib import Path
1010

1111

1212
def ConftestWithSetinitial(path):

testing/test_junitxml.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import os
22
import platform
33
from datetime import datetime
4-
from pathlib import Path
54
from xml.dom import minidom
65

76
import py
87
import xmlschema
98

109
import pytest
1110
from _pytest.junitxml import LogXML
11+
from _pytest.pathlib import Path
1212
from _pytest.reports import BaseReport
1313

1414

0 commit comments

Comments
 (0)