Practice - 5 Tasks
Answer the questions below
1fill in blank
easyComplete the code to specify the default pytest option for verbose output.
PyTest
[pytest]
addopts = [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-q' which reduces output instead of increasing it.
Using options unrelated to output verbosity.
✗ Incorrect
The '-v' option enables verbose output in pytest, showing detailed test results by default.
2fill in blank
mediumComplete the code to add a default option that stops pytest after the first failure.
PyTest
[pytest]
addopts = -v [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--disable-warnings' which only hides warnings.
Using '-q' which changes output verbosity.
✗ Incorrect
The '--maxfail=1' option tells pytest to stop running tests after the first failure.
3fill in blank
hardFix the error in the addopts line to correctly disable warnings by default.
PyTest
[pytest]
addopts = -v [1] Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the option with underscores or missing hyphens.
Using singular form instead of plural.
✗ Incorrect
The correct option to disable warnings in pytest is '--disable-warnings'.
4fill in blank
hardFill both blanks to set default options for verbose output and no output capture.
PyTest
[pytest] addopts = [1] [2]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-q' which reduces output instead of increasing it.
Confusing '--maxfail=1' with output capture options.
✗ Incorrect
The '-v' option enables verbose output, and '--capture=no' disables output capturing so you see print statements immediately.
5fill in blank
hardFill all three blanks to set default options for verbose output, stop after first failure, and disable warnings.
PyTest
[pytest] addopts = [1] [2] [3]
Drag options to blanks, or click blank then click option'
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-q' which reduces output instead of verbose.
Misspelling '--disable-warnings'.
✗ Incorrect
The '-v' option enables verbose output, '--maxfail=1' stops after the first failure, and '--disable-warnings' hides warnings by default.