summaryrefslogtreecommitdiff
path: root/testing/example_scripts
diff options
context:
space:
mode:
authorBruno Oliveira <nicoddemus@gmail.com>2018-10-03 19:42:41 -0300
committerBruno Oliveira <nicoddemus@gmail.com>2018-10-03 19:43:46 -0300
commit212937eb3ec9f7929b6f0d108d37f9823622f7e3 (patch)
treeda03b747aec98e79610fd3a3d1b8f3b180da56bb /testing/example_scripts
parente712adc22651d9c9be5adc1a3337353e0dd1b225 (diff)
downloadpytest-212937eb3ec9f7929b6f0d108d37f9823622f7e3.tar.gz
Improve error message when TestCase functions use a parametrized fixture
Fix #2535
Diffstat (limited to 'testing/example_scripts')
-rw-r--r--testing/example_scripts/unittest/test_parametrized_fixture_error_message.py13
1 files changed, 13 insertions, 0 deletions
diff --git a/testing/example_scripts/unittest/test_parametrized_fixture_error_message.py b/testing/example_scripts/unittest/test_parametrized_fixture_error_message.py
new file mode 100644
index 000000000..0b85bef3a
--- /dev/null
+++ b/testing/example_scripts/unittest/test_parametrized_fixture_error_message.py
@@ -0,0 +1,13 @@
+import pytest
+import unittest
+
+
+@pytest.fixture(params=[1, 2])
+def two(request):
+ return request.param
+
+
+@pytest.mark.usefixtures("two")
+class TestSomethingElse(unittest.TestCase):
+ def test_two(self):
+ pass