0
0
PyTesttesting~10 mins

setup.cfg 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 test paths in setup.cfg.

PyTest
[tool:pytest]
testpaths = [1]
Drag options to blanks, or click blank then click option'
Asrc
Bbuild
Ctests
Ddocs
Attempts:
3 left
💡 Hint
Common Mistakes
Using 'src' instead of 'tests' for testpaths.
Leaving testpaths empty or missing.
2fill in blank
medium

Complete the code to add markers configuration in setup.cfg.

PyTest
[tool:pytest]
markers =
    slow: marks tests as slow (skip with -m "not slow")
    [1]: marks tests that need database access
Drag options to blanks, or click blank then click option'
Afast
Bui
Capi
Ddb
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated marker names like 'fast' or 'ui' here.
Forgetting to add markers section.
3fill in blank
hard

Fix the error in the setup.cfg snippet to correctly ignore cache directories.

PyTest
[tool:pytest]
addopts = --cache-clear --ignore=[1]
Drag options to blanks, or click blank then click option'
A__pycache__
Bbuild
Ccache
Ddist
Attempts:
3 left
💡 Hint
Common Mistakes
Ignoring 'cache' instead of '__pycache__'.
Using unrelated folders like 'build' or 'dist'.
4fill in blank
hard

Fill both blanks to configure pytest to show detailed info and stop after first failure.

PyTest
[tool:pytest]
addopts = [1] [2]
Drag options to blanks, or click blank then click option'
A-v
B-q
C-x
D--maxfail=1
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-q' which reduces output instead of '-v'.
Using '--maxfail=1' instead of '-x' for stopping early.
5fill in blank
hard

Fill all three blanks to configure pytest to add markers, ignore cache, and set test paths.

PyTest
[tool:pytest]
markers = [1]: marks tests needing network
addopts = --ignore=[2]
testpaths = [3]
Drag options to blanks, or click blank then click option'
Anetwork
B__pycache__
Ctests
Dslow
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing marker names or ignoring wrong folders.
Setting testpaths to wrong folder.