0
0
PyTesttesting~10 mins

pyproject.toml 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 directory in pyproject.toml.

PyTest
[tool.pytest.ini_options]
testpaths = ["[1]"]
Drag options to blanks, or click blank then click option'
Adocs
Bsrc
Ctests
Dscripts
Attempts:
3 left
💡 Hint
Common Mistakes
Using source code folder name instead of test folder.
Using a folder that does not exist in the project.
2fill in blank
medium

Complete the code to add markers configuration in pyproject.toml.

PyTest
[tool.pytest.ini_options]
markers = ["[1]"]
Drag options to blanks, or click blank then click option'
Aintegration: marks integration tests
Bfast: marks tests as fast
Cunit: marks unit tests
Dslow: marks tests as slow
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the description after the colon.
Using markers not defined in the test code.
3fill in blank
hard

Fix the error in the pyproject.toml snippet to correctly set the minimum pytest version.

PyTest
[tool.pytest.ini_options]
minversion = "[1]"
Drag options to blanks, or click blank then click option'
A6.2
B5.4
C6.0
D7.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a number instead of a string.
Choosing a version too old that lacks features.
4fill in blank
hard

Fill both blanks to configure pytest to add options for test verbosity and disable warnings.

PyTest
[tool.pytest.ini_options]
addopts = "[1] [2]"
Drag options to blanks, or click blank then click option'
A-v
B-q
C-p no:warnings
D--maxfail=1
Attempts:
3 left
💡 Hint
Common Mistakes
Using quiet mode -q instead of verbose.
Using unrelated options like --maxfail=1.
5fill in blank
hard

Fill all three blanks to create a pytest configuration that sets test paths, markers, and disables warnings.

PyTest
[tool.pytest.ini_options]
testpaths = ["[1]"]
markers = ["[2]"]
addopts = "[3]"
Drag options to blanks, or click blank then click option'
Atests
Bslow: marks tests as slow
C-p no:warnings
Dsrc
Attempts:
3 left
💡 Hint
Common Mistakes
Using source folder instead of test folder.
Omitting marker description.
Not disabling warnings properly.