@@ -1074,6 +1074,9 @@ def parsefactories(self, node_or_obj, nodeid=NOTSET, unittest=False):
1074
1074
assert not name .startswith (self ._argprefix ), name
1075
1075
1076
1076
def new_fixture_def (name , scope ):
1077
+ """
1078
+ Creates and registers a new FixtureDef with given name and scope.
1079
+ """
1077
1080
fixture_def = FixtureDef (self , nodeid , name , obj ,
1078
1081
scope , marker .params ,
1079
1082
unittest = unittest , ids = marker .ids )
@@ -1101,6 +1104,13 @@ def new_fixture_def(name, scope):
1101
1104
self ._nodeid_and_autousenames .append ((nodeid or '' , autousenames ))
1102
1105
1103
1106
def getfixturedefs (self , argname , nodeid ):
1107
+ """
1108
+ Gets a list of fixtures which are applicable to the given node id.
1109
+
1110
+ :param str argname: name of the fixture to search for
1111
+ :param str nodeid: full node id of the requesting test.
1112
+ :return: list[FixtureDef]
1113
+ """
1104
1114
try :
1105
1115
fixturedefs = self ._arg2fixturedefs [argname ]
1106
1116
except KeyError :
@@ -1114,6 +1124,15 @@ def _matchfactories(self, fixturedefs, nodeid):
1114
1124
yield fixturedef
1115
1125
1116
1126
def getfixturedefs_multiple_scopes (self , argname , nodeid ):
1127
+ """
1128
+ Gets multiple scoped fixtures which are applicable to the given nodeid. Multiple scoped
1129
+ fixtures are usually created by "invocation" scoped fixtures and have argnames in
1130
+ the form: "<argname>:<scope>" (for example "tmpdir:session").
1131
+
1132
+ :return: dict of "argname" -> [FixtureDef].
1133
+
1134
+ Arguments similar to ``getfixturedefs``.
1135
+ """
1117
1136
prefix = argname + ':'
1118
1137
fixturedefs_by_argname = dict ((k , v ) for k , v in self ._arg2fixturedefs .items ()
1119
1138
if k .startswith (prefix ))
0 commit comments