0
0
PyTesttesting~10 mins

pytest.ini configuration - 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 minimum pytest version in pytest.ini.

PyTest
[pytest]
minversion = [1]
Drag options to blanks, or click blank then click option'
A6.0
B5.0
C7.0
D4.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using a version number that is too new or too old.
Forgetting to put the version as a string.
2fill in blank
medium

Complete the code to add markers section in pytest.ini.

PyTest
[pytest]
markers =
    slow: marks tests as slow to run [1]
Drag options to blanks, or click blank then click option'
A# mark slow tests
B# ignore these tests
C# run these tests only
D# skip these tests
Attempts:
3 left
💡 Hint
Common Mistakes
Using comments that confuse the purpose of the marker.
Leaving the comment empty or unrelated.
3fill in blank
hard

Fix the error in pytest.ini to correctly add testpaths.

PyTest
[pytest]
testpaths = [1]
Drag options to blanks, or click blank then click option'
A[tests]
Btests/
C'tests'
Dtests
Attempts:
3 left
💡 Hint
Common Mistakes
Adding brackets or quotes which cause syntax errors.
Using a trailing slash which is optional but not recommended.
4fill in blank
hard

Fill both blanks to configure pytest to add options for verbose output and disable warnings.

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

Fill all three blanks to create a pytest.ini that sets minversion, adds a marker, and sets testpaths.

PyTest
[pytest]
minversion = [1]
markers =
    integration: [2]
testpaths = [3]
Drag options to blanks, or click blank then click option'
A5.4
Bmarks integration tests
Cintegration_tests
D6.0
Attempts:
3 left
💡 Hint
Common Mistakes
Using an invalid version number.
Putting quotes around testpaths folder name.
Writing marker comment incorrectly.