0
0
PyTesttesting~10 mins

Testpaths configuration in PyTest - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the testpaths in pytest configuration.

PyTest
[pytest]
testpaths = [1]
Drag options to blanks, or click blank then click option'
Adocs
Bsrc
Ctests
Dsetup.py
Attempts:
3 left
💡 Hint
Common Mistakes
Using source code folder instead of test folder
Using a file name instead of a folder
2fill in blank
medium

Complete the pytest configuration to include multiple testpaths.

PyTest
[pytest]
testpaths = [1]
Drag options to blanks, or click blank then click option'
Adocs tests
Btests integration_tests
Csrc tests
Dsetup.py tests
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas instead of spaces
Including non-test folders
3fill in blank
hard

Fix the error in the pytest configuration to correctly specify testpaths.

PyTest
[pytest]
testpaths = [1]
Drag options to blanks, or click blank then click option'
Atests integration_tests
Btests,integration_tests
Ctests,integration_tests,
Dtests;integration_tests
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas or semicolons to separate folders
Adding trailing commas
4fill in blank
hard

Fill both blanks to configure pytest to look for tests in the 'tests' folder and specify the pattern for test files.

PyTest
[pytest]
testpaths = [1]
python_files = [2]
Drag options to blanks, or click blank then click option'
Atests
Bsrc
Ctest_*.py
Dcheck_*.py
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong folder name
Using incorrect file pattern
5fill in blank
hard

Fill all three blanks to configure pytest to look in 'tests' and 'integration_tests' folders, use 'test_*.py' pattern for files, and 'Test*' prefix for test classes.

PyTest
[pytest]
testpaths = [1]
python_files = [2]
python_classes = [3]
Drag options to blanks, or click blank then click option'
Atests integration_tests
Btest_*.py
CTest*
Dcheck_*
Attempts:
3 left
💡 Hint
Common Mistakes
Using commas instead of spaces for folders
Missing * wildcard in patterns