From cbb59747af48ae60473f27b6de976a08a741ab54 Mon Sep 17 00:00:00 2001 From: Scott Sanderson Date: Thu, 21 Jan 2016 21:03:32 -0500 Subject: [PATCH] TEST: Add test for parameter_space ordering. --- tests/test_test_utils.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tests/test_test_utils.py b/tests/test_test_utils.py index 861d10bc..e62dc7a3 100644 --- a/tests/test_test_utils.py +++ b/tests/test_test_utils.py @@ -14,16 +14,24 @@ class TestParameterSpace(TestCase): @classmethod def setUpClass(cls): cls.xy_invocations = [] + cls.yx_invocations = [] @classmethod def tearDownClass(cls): # This is the only actual test here. assert cls.xy_invocations == list(product(cls.x_args, cls.y_args)) + assert cls.yx_invocations == list(product(cls.y_args, cls.x_args)) @parameter_space(x=x_args, y=y_args) def test_xy(self, x, y): self.xy_invocations.append((x, y)) + @parameter_space(x=x_args, y=y_args) + def test_yx(self, y, x): + # Ensure that product is called with args in the order that they appear + # in the function's parameter list. + self.yx_invocations.append((y, x)) + def test_nothing(self): # Ensure that there's at least one "real" test in the class, or else # our {setUp,tearDown}Class won't be called if, for example,