Merge pull request #3246 from RonnyPfannschmidt/remove-addcall-in-tests
remove addcall in the terminal tests
This commit is contained in:
commit
7336dbb979
|
@ -0,0 +1 @@
|
||||||
|
Remove usage of deprecated ``metafunc.addcall`` in our own tests.
|
|
@ -32,16 +32,19 @@ class Option(object):
|
||||||
return values
|
return values
|
||||||
|
|
||||||
|
|
||||||
def pytest_generate_tests(metafunc):
|
@pytest.fixture(params=[
|
||||||
if "option" in metafunc.fixturenames:
|
Option(verbose=False),
|
||||||
metafunc.addcall(id="default",
|
Option(verbose=True),
|
||||||
funcargs={'option': Option(verbose=False)})
|
Option(verbose=-1),
|
||||||
metafunc.addcall(id="verbose",
|
Option(fulltrace=True),
|
||||||
funcargs={'option': Option(verbose=True)})
|
], ids=[
|
||||||
metafunc.addcall(id="quiet",
|
"default",
|
||||||
funcargs={'option': Option(verbose=-1)})
|
"verbose",
|
||||||
metafunc.addcall(id="fulltrace",
|
"quiet",
|
||||||
funcargs={'option': Option(fulltrace=True)})
|
"fulltrace",
|
||||||
|
])
|
||||||
|
def option(request):
|
||||||
|
return request.param
|
||||||
|
|
||||||
|
|
||||||
@pytest.mark.parametrize('input,expected', [
|
@pytest.mark.parametrize('input,expected', [
|
||||||
|
@ -682,10 +685,12 @@ def test_color_yes_collection_on_non_atty(testdir, verbose):
|
||||||
|
|
||||||
|
|
||||||
def test_getreportopt():
|
def test_getreportopt():
|
||||||
class config(object):
|
class Config(object):
|
||||||
class option(object):
|
class Option(object):
|
||||||
reportchars = ""
|
reportchars = ""
|
||||||
disable_warnings = True
|
disable_warnings = True
|
||||||
|
option = Option()
|
||||||
|
config = Config()
|
||||||
|
|
||||||
config.option.reportchars = "sf"
|
config.option.reportchars = "sf"
|
||||||
assert getreportopt(config) == "sf"
|
assert getreportopt(config) == "sf"
|
||||||
|
|
Loading…
Reference in New Issue