0
0
PyTesttesting~10 mins

Addopts for default options 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 default pytest option for verbose output.

PyTest
[pytest]
addopts = [1]
Drag options to blanks, or click blank then click option'
A-q
B-v
C--maxfail=1
D--disable-warnings
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-q' which reduces output instead of increasing it.
Using options unrelated to output verbosity.
2fill in blank
medium

Complete 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'
A--disable-warnings
B--capture=no
C-q
D--maxfail=1
Attempts:
3 left
💡 Hint
Common Mistakes
Using '--disable-warnings' which only hides warnings.
Using '-q' which changes output verbosity.
3fill in blank
hard

Fix 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'
A--disable_warning
B--disablewarnings
C--disable-warnings
D--disable-warn
Attempts:
3 left
💡 Hint
Common Mistakes
Misspelling the option with underscores or missing hyphens.
Using singular form instead of plural.
4fill in blank
hard

Fill 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'
A-v
B--capture=no
C--maxfail=1
D-q
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-q' which reduces output instead of increasing it.
Confusing '--maxfail=1' with output capture options.
5fill in blank
hard

Fill 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'
A-v
B--maxfail=1
C--disable-warnings
D-q
Attempts:
3 left
💡 Hint
Common Mistakes
Using '-q' which reduces output instead of verbose.
Misspelling '--disable-warnings'.