0
0
PyTesttesting~10 mins

Running tests (pytest command) - Interactive Code Practice

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

Complete the code to run pytest from the command line.

PyTest
pytest [1]
Drag options to blanks, or click blank then click option'
A--help
B--version
C--run
D--test
Attempts:
3 left
💡 Hint
Common Mistakes
Using options that do not exist like --run or --test.
2fill in blank
medium

Complete the command to run tests in a specific file named test_sample.py.

PyTest
pytest [1]
Drag options to blanks, or click blank then click option'
Asample_test.py
Btest.py
Ctests.py
Dtest_sample.py
Attempts:
3 left
💡 Hint
Common Mistakes
Using incorrect filenames that do not exist.
3fill in blank
hard

Fix the error in the command to run pytest with verbose output.

PyTest
pytest [1]
Drag options to blanks, or click blank then click option'
A--verbose
B-verbose
C-v
D-verbose-output
Attempts:
3 left
💡 Hint
Common Mistakes
Using long or incorrect option names like --verbose or -verbose-output.
4fill in blank
hard

Fill both blanks to run pytest and stop after first failure with detailed output.

PyTest
pytest [1] [2]
Drag options to blanks, or click blank then click option'
A-v
B-q
C-x
D--maxfail=1
Attempts:
3 left
💡 Hint
Common Mistakes
Using --maxfail=1 instead of -x for stopping on failure.
5fill in blank
hard

Fill all three blanks to run pytest on a directory tests, show detailed output, and stop after 2 failures.

PyTest
pytest [1] [2] [3]
Drag options to blanks, or click blank then click option'
Atests
B-v
C--maxfail=2
D-x
Attempts:
3 left
💡 Hint
Common Mistakes
Using -x instead of --maxfail=2 to stop after two failures.