PyTest - Test OrganizationWhich of the following directories will pytest search for tests by default?AAny directory containing a file named 'setup.py'BDirectories named 'test' or 'tests' in the current folderCOnly the root directory of the projectDDirectories named 'src' or 'lib'Check Answer
Step-by-Step SolutionSolution:Step 1: Understand pytest default directory searchpytest looks for directories named 'test' or 'tests' to find test files.Step 2: Eliminate other directory optionsDirectories like 'src', 'lib', or those with 'setup.py' are not searched by default.Final Answer:Directories named 'test' or 'tests' in the current folder -> Option BQuick Check:Default test directories = 'test' or 'tests' [OK]Quick Trick: pytest looks in 'test' or 'tests' folders by default [OK]Common Mistakes:MISTAKESAssuming pytest searches all foldersThinking 'src' or 'lib' are default test foldersConfusing 'setup.py' presence with test discovery
Master "Test Organization" in PyTest9 interactive learning modes - each teaches the same concept differentlyLearnWhyDeepTraceTryChallengeAutomateRecallFrame
More PyTest Quizzes Markers - Registering markers in pytest.ini - Quiz 2easy Markers - Registering markers in pytest.ini - Quiz 15hard PyTest Basics and Setup - Running tests (pytest command) - Quiz 9hard PyTest Basics and Setup - PyTest vs unittest vs nose comparison - Quiz 4medium PyTest Basics and Setup - Why PyTest is the most popular Python testing framework - Quiz 13medium PyTest Basics and Setup - Running tests (pytest command) - Quiz 14medium Test Organization - Test packages - Quiz 7medium Test Organization - Grouping related tests - Quiz 8hard Writing Assertions - Comparing values (equality, inequality) - Quiz 2easy Writing Assertions - Asserting exceptions (pytest.raises) - Quiz 15hard