fix rebase mistakes
This commit is contained in:
parent
efe03400d8
commit
6165939b0d
|
@ -390,7 +390,8 @@ def transfer_markers(funcobj, cls, mod):
|
||||||
if not _marked(funcobj, pytestmark):
|
if not _marked(funcobj, pytestmark):
|
||||||
pytestmark(funcobj)
|
pytestmark(funcobj)
|
||||||
|
|
||||||
class Module(pytest.File, PyCollector):
|
|
||||||
|
class Module(main.File, PyCollector):
|
||||||
""" Collector for test classes and functions. """
|
""" Collector for test classes and functions. """
|
||||||
|
|
||||||
def _getobj(self):
|
def _getobj(self):
|
||||||
|
@ -775,7 +776,7 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
|
||||||
to set a dynamic scope using test context or configuration.
|
to set a dynamic scope using test context or configuration.
|
||||||
"""
|
"""
|
||||||
from _pytest.fixtures import scope2index
|
from _pytest.fixtures import scope2index
|
||||||
from _pytest.mark import extract_argvalue, MARK_GEN
|
from _pytest.mark import MARK_GEN, ParameterSet
|
||||||
from py.io import saferepr
|
from py.io import saferepr
|
||||||
|
|
||||||
if not isinstance(argnames, (tuple, list)):
|
if not isinstance(argnames, (tuple, list)):
|
||||||
|
@ -788,12 +789,11 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
|
||||||
for x in argvalues]
|
for x in argvalues]
|
||||||
del argvalues
|
del argvalues
|
||||||
|
|
||||||
|
|
||||||
if not parameters:
|
if not parameters:
|
||||||
fs, lineno = getfslineno(self.function)
|
fs, lineno = getfslineno(self.function)
|
||||||
reason = "got empty parameter set %r, function %s at %s:%d" % (
|
reason = "got empty parameter set %r, function %s at %s:%d" % (
|
||||||
argnames, self.function.__name__, fs, lineno)
|
argnames, self.function.__name__, fs, lineno)
|
||||||
mark = pytest.mark.skip(reason=reason)
|
mark = MARK_GEN.skip(reason=reason)
|
||||||
parameters.append(ParameterSet(
|
parameters.append(ParameterSet(
|
||||||
values=(NOTSET,) * len(argnames),
|
values=(NOTSET,) * len(argnames),
|
||||||
marks=[mark],
|
marks=[mark],
|
||||||
|
@ -870,7 +870,7 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
|
||||||
if funcargs is not None:
|
if funcargs is not None:
|
||||||
for name in funcargs:
|
for name in funcargs:
|
||||||
if name not in self.fixturenames:
|
if name not in self.fixturenames:
|
||||||
pytest.fail("funcarg %r not used in this function." % name)
|
fail("funcarg %r not used in this function." % name)
|
||||||
else:
|
else:
|
||||||
funcargs = {}
|
funcargs = {}
|
||||||
if id is None:
|
if id is None:
|
||||||
|
@ -945,6 +945,7 @@ def _idval(val, argname, idx, idfn, config=None):
|
||||||
return val.__name__
|
return val.__name__
|
||||||
return str(argname)+str(idx)
|
return str(argname)+str(idx)
|
||||||
|
|
||||||
|
|
||||||
def _idvalset(idx, parameterset, argnames, idfn, ids, config=None):
|
def _idvalset(idx, parameterset, argnames, idfn, ids, config=None):
|
||||||
if parameterset.id is not None:
|
if parameterset.id is not None:
|
||||||
return parameterset.id
|
return parameterset.id
|
||||||
|
@ -955,6 +956,7 @@ def _idvalset(idx, parameterset, argnames, idfn, ids, config=None):
|
||||||
else:
|
else:
|
||||||
return _escape_strings(ids[idx])
|
return _escape_strings(ids[idx])
|
||||||
|
|
||||||
|
|
||||||
def idmaker(argnames, parametersets, idfn=None, ids=None, config=None):
|
def idmaker(argnames, parametersets, idfn=None, ids=None, config=None):
|
||||||
ids = [_idvalset(valindex, parameterset, argnames, idfn, ids, config)
|
ids = [_idvalset(valindex, parameterset, argnames, idfn, ids, config)
|
||||||
for valindex, parameterset in enumerate(parametersets)]
|
for valindex, parameterset in enumerate(parametersets)]
|
||||||
|
@ -1033,6 +1035,7 @@ def showfixtures(config):
|
||||||
from _pytest.main import wrap_session
|
from _pytest.main import wrap_session
|
||||||
return wrap_session(config, _showfixtures_main)
|
return wrap_session(config, _showfixtures_main)
|
||||||
|
|
||||||
|
|
||||||
def _showfixtures_main(config, session):
|
def _showfixtures_main(config, session):
|
||||||
import _pytest.config
|
import _pytest.config
|
||||||
session.perform_collect()
|
session.perform_collect()
|
||||||
|
|
Loading…
Reference in New Issue