summaryrefslogtreecommitdiff
path: root/testing/example_scripts
diff options
context:
space:
mode:
authorRonny Pfannschmidt <opensource@ronnypfannschmidt.de>2018-10-06 07:43:57 +0200
committerGitHub <noreply@github.com>2018-10-06 07:43:57 +0200
commit66609665f20982e48ef5c147954758f9c05c5422 (patch)
tree9b039e7382fcbcb11968748b271ead4f0b6cb44f /testing/example_scripts
parenta1208f56319470c2ce37d0a0aa694e4423bed314 (diff)
parent212937eb3ec9f7929b6f0d108d37f9823622f7e3 (diff)
downloadpytest-66609665f20982e48ef5c147954758f9c05c5422.tar.gz
Merge pull request #4076 from nicoddemus/unittest-param-fixture-msg
Improve error message when TestCase functions use a parametrized fixture
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