TvoroG / pytest-lazy-fixture

It helps to use fixtures in pytest.mark.parametrize
MIT License
379 stars 30 forks source link

autouse=True of lazy_fixture breaks nose tests #50

Open MRigal opened 4 years ago

MRigal commented 4 years ago

Hi all,

We have some legacy nose-style tests in our test suite. They are also run nicely via pytest (https://docs.pytest.org/en/latest/nose.html).

Today I've tried to add a fixture with parametrization using lazy_fixture in combination with autouse=True and the tests are now ERRORing with:

_____ ERROR at setup of MyNoseTestClass.test_foo ________
test_foo does not support fixtures, maybe unittest.TestCase subclass?
Node id: path/test_foo.py::MyNoseTestClass::test_foo
Function type: TestCaseFunction

The indication is right and maybe some check would avoid this issue.

Not that some other fixtures with autouse=True but without lazy_fixture are not changing the test behaviour