summaryrefslogtreecommitdiff
path: root/src/_pytest
diff options
context:
space:
mode:
authorSanket Duthade <duthades@gmail.com>2020-11-07 20:26:00 +0530
committerGitHub <noreply@github.com>2020-11-07 16:56:00 +0200
commit3bcd316f076b185bcc89c41a41345861f752aff7 (patch)
tree3ffa087535f7dff966b374022fe9e8b1dce95bce /src/_pytest
parent6a5037a25b98106c1e8e325ae939ffb67269c58b (diff)
downloadpytest-3bcd316f076b185bcc89c41a41345861f752aff7.tar.gz
test_collection.py migrate from testdir to Pytester (#8003)
Diffstat (limited to 'src/_pytest')
-rw-r--r--src/_pytest/pytester.py7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/_pytest/pytester.py b/src/_pytest/pytester.py
index 935be84c1..43ccc97c6 100644
--- a/src/_pytest/pytester.py
+++ b/src/_pytest/pytester.py
@@ -50,7 +50,6 @@ from _pytest.monkeypatch import MonkeyPatch
from _pytest.nodes import Collector
from _pytest.nodes import Item
from _pytest.pathlib import make_numbered_dir
-from _pytest.python import Module
from _pytest.reports import CollectReport
from _pytest.reports import TestReport
from _pytest.tmpdir import TempPathFactory
@@ -652,7 +651,7 @@ class Pytester:
) -> None:
self._request = request
self._mod_collections: WeakKeyDictionary[
- Module, List[Union[Item, Collector]]
+ Collector, List[Union[Item, Collector]]
] = (WeakKeyDictionary())
if request.function:
name: str = request.function.__name__
@@ -1244,7 +1243,7 @@ class Pytester:
return self.getnode(config, path)
def collect_by_name(
- self, modcol: Module, name: str
+ self, modcol: Collector, name: str
) -> Optional[Union[Item, Collector]]:
"""Return the collection node for name from the module collection.
@@ -1639,7 +1638,7 @@ class Testdir:
)
def collect_by_name(
- self, modcol: Module, name: str
+ self, modcol: Collector, name: str
) -> Optional[Union[Item, Collector]]:
"""See :meth:`Pytester.collect_by_name`."""
return self._pytester.collect_by_name(modcol, name)