File tree Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Expand file tree Collapse file tree 1 file changed +15
-17
lines changed Original file line number Diff line number Diff line change @@ -1485,23 +1485,21 @@ def getfixtureinfo(
14851485
14861486 def pytest_plugin_registered (self , plugin : _PluggyPlugin ) -> None :
14871487 nodeid = None
1488- try :
1489- p = absolutepath (plugin .__file__ ) # type: ignore[attr-defined]
1490- except AttributeError :
1491- pass
1492- else :
1493- # Construct the base nodeid which is later used to check
1494- # what fixtures are visible for particular tests (as denoted
1495- # by their test id).
1496- if p .name == "conftest.py" :
1497- try :
1498- nodeid = str (p .parent .relative_to (self .config .rootpath ))
1499- except ValueError :
1500- nodeid = ""
1501- if nodeid == "." :
1502- nodeid = ""
1503- if os .sep != nodes .SEP :
1504- nodeid = nodeid .replace (os .sep , nodes .SEP )
1488+ plugin_name = self .config .pluginmanager .get_name (plugin )
1489+
1490+ # Construct the base nodeid which is later used to check
1491+ # what fixtures are visible for particular tests (as denoted
1492+ # by their test id).
1493+ if plugin_name .endswith ("conftest.py" ):
1494+ p = absolutepath (plugin_name )
1495+ try :
1496+ nodeid = str (p .parent .relative_to (self .config .rootpath ))
1497+ except ValueError :
1498+ nodeid = ""
1499+ if nodeid == "." :
1500+ nodeid = ""
1501+ if os .sep != nodes .SEP :
1502+ nodeid = nodeid .replace (os .sep , nodes .SEP )
15051503
15061504 self .parsefactories (plugin , nodeid )
15071505
You can’t perform that action at this time.
0 commit comments