PyTest - Fixtures
You want a pytest fixture to open a database connection before a test and ensure it closes after, regardless of test outcome. Which feature should you use?
yield in fixtures.yield runs before the test (setup), code after runs after (teardown).yield to separate setup and teardown correctly uses a generator fixture with yield for setup and teardown.yield to separate setup and teardown -> Option B15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions