Merge pull request #3246 from RonnyPfannschmidt/remove-addcall-in-tests

remove addcall in the terminal tests
This commit is contained in:
Bruno Oliveira 2018-02-21 19:42:53 -03:00 committed by GitHub
commit 7336dbb979
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 12 deletions

View File

@ -0,0 +1 @@
Remove usage of deprecated ``metafunc.addcall`` in our own tests.

View File

@ -32,16 +32,19 @@ class Option(object):
return values
def pytest_generate_tests(metafunc):
if "option" in metafunc.fixturenames:
metafunc.addcall(id="default",
funcargs={'option': Option(verbose=False)})
metafunc.addcall(id="verbose",
funcargs={'option': Option(verbose=True)})
metafunc.addcall(id="quiet",
funcargs={'option': Option(verbose=-1)})
metafunc.addcall(id="fulltrace",
funcargs={'option': Option(fulltrace=True)})
@pytest.fixture(params=[
Option(verbose=False),
Option(verbose=True),
Option(verbose=-1),
Option(fulltrace=True),
], ids=[
"default",
"verbose",
"quiet",
"fulltrace",
])
def option(request):
return request.param
@pytest.mark.parametrize('input,expected', [
@ -682,10 +685,12 @@ def test_color_yes_collection_on_non_atty(testdir, verbose):
def test_getreportopt():
class config(object):
class option(object):
class Config(object):
class Option(object):
reportchars = ""
disable_warnings = True
option = Option()
config = Config()
config.option.reportchars = "sf"
assert getreportopt(config) == "sf"