0

Pytest fixtures seems like a very powerful tool. I never used them for now, except ones with autouse=True because a test function defined with fixture1 and fixture2 can not be run anymore as:

from module.tests import test_with_fixtures

test_with_fixtures()

It's now missing 2 required positional arguments, fixture1 and fixture2. And since you can not call fixture directly.. what is the usual way to work with unit test defined with fixtures?

Mathieu
  • 5,410
  • 6
  • 28
  • 55
  • unittest.TestCase and pytest fixtures cannot be combined. https://stackoverflow.com/a/18187731/7058266 Is that what you're asking? There are alternatives though to accomplish the same goals. – Michael Mintz Jun 30 '23 at 13:11
  • No, because I'm using test functions and not class. e.g. if I have a function signature `test_something()`, without arguments and fixture; it's very simple to improve and/or debug because you can import `test_something` and run it in an IDE in debug mode, line by line. – Mathieu Jun 30 '23 at 13:14

0 Answers0