From 2e8a2df1fbd4c1d7ee7035dff6484ec5d093c5f1 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 11 Jul 2017 14:53:31 +0200 Subject: [PATCH] tests: fix pytest API "surprise" in skipping tests pytest.mark.skipif apparently iterates through a class's methods, applying itself onto the various methods. Now, since we're deriving from a parent class, the method is actually the same object inherited from the parent, so the decorator will apply itself on the parent's testrunning method (test_refout). The result is that any TestRefout tests after "test_commands.py" will be skipped... This only became apparent after adding ospf6d/test_lsdb.py; before, test_commands.py was the last test in the list so it didn't matter... Signed-off-by: David Lamparter --- tests/lib/cli/test_commands.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/tests/lib/cli/test_commands.py b/tests/lib/cli/test_commands.py index 85e34fa15b..bda0bbac44 100644 --- a/tests/lib/cli/test_commands.py +++ b/tests/lib/cli/test_commands.py @@ -2,7 +2,10 @@ import frrtest import pytest import os -@pytest.mark.skipif('QUAGGA_TEST_COMMANDS' not in os.environ, - reason='QUAGGA_TEST_COMMANDS not set') class TestCommands(frrtest.TestRefOut): program = './test_commands' + + @pytest.mark.skipif('QUAGGA_TEST_COMMANDS' not in os.environ, + reason='QUAGGA_TEST_COMMANDS not set') + def test_refout(self): + return super(TestCommands, self).test_refout(self) -- 2.39.5