0
0
PyTesttesting~10 mins

Registering markers in pytest.ini - Interactive Code Practice

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

Complete the code to register a custom marker named 'slow' in pytest.ini.

PyTest
[pytest]
markers =
    [1]: marks tests as slow
Drag options to blanks, or click blank then click option'
Afast
Bslow
Cskip
Dparametrize
Attempts:
3 left
💡 Hint
Common Mistakes
Using a marker name not matching the test decorator.
Leaving the markers section empty.
2fill in blank
medium

Complete the code to register two markers 'slow' and 'database' in pytest.ini.

PyTest
[pytest]
markers =
    slow: marks tests as slow
    [1]: marks tests that use the database
Drag options to blanks, or click blank then click option'
Adatabase
Bnetwork
Capi
Dui
Attempts:
3 left
💡 Hint
Common Mistakes
Using unrelated marker names.
Misspelling the marker name.
3fill in blank
hard

Fix the error in the pytest.ini snippet by completing the missing marker name.

PyTest
[pytest]
markers =
    slow: marks tests as slow
    [1] marks tests that require network access
Drag options to blanks, or click blank then click option'
Anetwork-
Bnetwork
Cnetwork:
Dnetwork;
Attempts:
3 left
💡 Hint
Common Mistakes
Omitting the colon after the marker name.
Using invalid punctuation.
4fill in blank
hard

Fill both blanks to correctly register markers 'slow' and 'api' with descriptions.

PyTest
[pytest]
markers =
    [1]: marks tests as slow
    [2]: marks tests that test the API
Drag options to blanks, or click blank then click option'
Aslow
Bfast
Capi
Dui
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing marker names.
Forgetting the colon after marker names.
5fill in blank
hard

Fill all three blanks to register markers 'slow', 'database', and 'network' with descriptions.

PyTest
[pytest]
markers =
    [1]: marks tests as slow
    [2]: marks tests that use the database
    [3]: marks tests that require network access
Drag options to blanks, or click blank then click option'
Aslow
Bdatabase
Cnetwork
Dui
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect marker names.
Omitting colons after marker names.