PyTest - MarkersWhich command runs only tests marked with 'database' in pytest?Apytest --run-databaseBpytest -m databaseCpytest -mark databaseDpytest --only databaseCheck Answer
Step-by-Step SolutionSolution:Step 1: Recall pytest syntax for running marked testsThe correct syntax uses '-m' followed by the marker name to select tests.Step 2: Verify options against pytest documentationOnly 'pytest -m database' matches the correct command format.Final Answer:pytest -m database -> Option BQuick Check:Run marked tests = pytest -m [OK]Quick Trick: Use '-m' to run tests by marker name [OK]Common Mistakes:MISTAKESUsing '--run-database' which is invalidTyping '-mark' instead of '-m'Using '--only' which pytest doesn't support
Master "Markers" in PyTest9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepTraceTryChallengeAutomateRecallFrame
More PyTest Quizzes Fixtures - Fixture scope (function, class, module, session) - Quiz 6medium Fixtures - Conftest fixtures (shared across files) - Quiz 9hard Markers - @pytest.mark.xfail for expected failures - Quiz 7medium Parametrize - Single parameter - Quiz 11easy PyTest Basics and Setup - Running tests (pytest command) - Quiz 9hard Test Organization - Test modules - Quiz 1medium Test Organization - Why organized tests scale with projects - Quiz 5medium Test Organization - Test packages - Quiz 3easy Writing Assertions - Checking identity (is, is not) - Quiz 1easy Writing Assertions - Checking membership (in, not in) - Quiz 9hard