Skip to content

Commit ac2cd72

Browse files
authored
Merge pull request #11856 from bluetech/pluggy-unblock
config: use `pluginmanager.unblock` instead of accessing pluggy's internals
2 parents 2a77f8d + bca4bb0 commit ac2cd72

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ repos:
6464
additional_dependencies:
6565
- iniconfig>=1.1.0
6666
- attrs>=19.2.0
67-
- pluggy
67+
- pluggy>=1.4.0
6868
- packaging
6969
- tomli
7070
- types-pkg_resources

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ py_modules = py
4646
install_requires =
4747
iniconfig
4848
packaging
49-
pluggy>=1.3.0,<2.0
49+
pluggy>=1.4.0,<2.0
5050
colorama;sys_platform=="win32"
5151
exceptiongroup>=1.0.0rc8;python_version<"3.11"
5252
tomli>=1.0.0;python_version<"3.11"

src/_pytest/config/__init__.py

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -745,13 +745,10 @@ def consider_pluginarg(self, arg: str) -> None:
745745
self.set_blocked("pytest_" + name)
746746
else:
747747
name = arg
748-
# Unblock the plugin. None indicates that it has been blocked.
749-
# There is no interface with pluggy for this.
750-
if self._name2plugin.get(name, -1) is None:
751-
del self._name2plugin[name]
748+
# Unblock the plugin.
749+
self.unblock(name)
752750
if not name.startswith("pytest_"):
753-
if self._name2plugin.get("pytest_" + name, -1) is None:
754-
del self._name2plugin["pytest_" + name]
751+
self.unblock("pytest_" + name)
755752
self.import_plugin(arg, consider_entry_points=True)
756753

757754
def consider_conftest(

0 commit comments

Comments
 (0)