From 3d4d0a261468e9f354b86f5149fe4dc2e8a85c7e Mon Sep 17 00:00:00 2001 From: Ronny Pfannschmidt Date: Wed, 21 Feb 2018 18:54:39 +0100 Subject: [PATCH 1/2] remove addcall in the terminal tests --- changelog/3246.trival.rst | 1 + testing/test_terminal.py | 29 +++++++++++++++++------------ 2 files changed, 18 insertions(+), 12 deletions(-) create mode 100644 changelog/3246.trival.rst diff --git a/changelog/3246.trival.rst b/changelog/3246.trival.rst new file mode 100644 index 000000000..621028966 --- /dev/null +++ b/changelog/3246.trival.rst @@ -0,0 +1 @@ +remove usage of the deprecated addcall in our own tests \ No newline at end of file diff --git a/testing/test_terminal.py b/testing/test_terminal.py index b3ea01709..c9e0eb8b3 100644 --- a/testing/test_terminal.py +++ b/testing/test_terminal.py @@ -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" From d844ad18c2c5cc7241278e7ecb4f764c81baca53 Mon Sep 17 00:00:00 2001 From: Bruno Oliveira Date: Wed, 21 Feb 2018 15:40:25 -0300 Subject: [PATCH 2/2] Fix formatting of CHANGELOG entry --- changelog/3246.trival.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/changelog/3246.trival.rst b/changelog/3246.trival.rst index 621028966..58e13a1dd 100644 --- a/changelog/3246.trival.rst +++ b/changelog/3246.trival.rst @@ -1 +1 @@ -remove usage of the deprecated addcall in our own tests \ No newline at end of file +Remove usage of deprecated ``metafunc.addcall`` in our own tests.