-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cannot decorate @pytest.mark.usefixtures("xy") onto class inherits from unittest.TestCase #3484
Comments
parametrization is not supported for unittest tests btw, this is a duplicate issue i will find the original one later |
GitMate.io thinks possibly related issues are #541 (Can't use pytest.mark.parametrize inside unittest class), #378 (@pytest.mark.usefixtures take no effects on fixtures), #1464 (pytest.mark on TestCase affects base classes), #3308 (Question: Can someone explain the below uses of @pytest.mark.usefixtures), and #2806 (mark.usefixtures registered fixtures of all test class subclasses invoked despite -k). |
oh - gitmate already did - the issue is #541 |
Thanks @RonnyPfannschmidt ! Also I don't think #541 is a duplication. Here is the reason: |
the use case is invalid - parametrized fixtures and tests do not support unittest - and will never support unittest parameterize and fixtures with params are only availiable to native pytest tests |
also #541 applies since both |
Agh, got it. Thanks for clarifying. You the best! |
Splitting test_swap_creation_method into 3 different cases for different filesystems. Leaving the methods way of asserting the test with only cc_mounts.handle() function. Like test_swap_integrity() does. Signed-off-by: Eduardo Otubo <[email protected]> [0] pytest-dev/pytest#3484
minimum example:
motivation of such example:
pytest allows @pytest.mark.parametrize decorated on test functions on module level. One could have developed tests as
my incentive on applying fixture onto class level is to leverage predefined test methods in super class, such as assertRaises in unittest.TestClass. if @pytest.mark.usefixtures cannot decorate on general classes, the use of it is less obvious, as @pytest.mark.parametrize functions the same and easier to write.
The text was updated successfully, but these errors were encountered: