Skip to main content
Fixed typo where "test_case0012" was given as an example of something that starts with "test_001" (which it doesn't!)... & Added a link to the documentation to get to 6 characters.
Source Link

You can use -k option-k option to run test cases with different patterns:

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting the rest of the test cases.

Note: This will select any test case starting with test_001 or test_some_other_test. For example, if you have test case test_case0012test_0012 it will also be selected.

You can use -k option to run test cases with different patterns:

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting the rest of the test cases.

Note: This will select any test case starting with test_001 or test_some_other_test. For example, if you have test case test_case0012 it will also be selected.

You can use -k option to run test cases with different patterns:

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting the rest of the test cases.

Note: This will select any test case starting with test_001 or test_some_other_test. For example, if you have test case test_0012 it will also be selected.

Remove redundant sentence, grammar cleanup
Source Link
Brad Koch
  • 19.9k
  • 20
  • 111
  • 140

You can use -k option to run test cases with different patterns

You can use something like this:

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting the rest of the test cases.

Note: This will select any test case starting with test_001 or test_some_other_test test_some_other_test  . EgFor example, if you have test case test_case0012 it will will also be selected.

You can use -k option to run test cases with different patterns

You can use something like this

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting rest test cases.

Note: This will select any test case starting with test_001 or test_some_other_test  . Eg if you have test case test_case0012 it will also be selected

You can use -k option to run test cases with different patterns:

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting the rest of the test cases.

Note: This will select any test case starting with test_001 or test_some_other_test. For example, if you have test case test_case0012 it will also be selected.

added 54 characters in body
Source Link
supamaze
  • 9.1k
  • 2
  • 12
  • 11

You can use -k option to run test cases with different patterns

You can use something like this

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting rest test cases.

Note: This will select any test case starting with test_001 or test_some_other_test . Eg if you have test case test_case0012 it will also be selected

You can use -k option to run test cases with different patterns

You can use something like this

-k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting rest test cases.

Note: This will select any test case starting with test_001 or test_some_other_test . Eg if you have test case test_case0012 it will also be selected

You can use -k option to run test cases with different patterns

You can use something like this

py.test tests_directory/foo.py tests_directory/bar.py -k 'test_001 or test_some_other_test'

This will run test cases with name test_001 and test_some_other_test deselecting rest test cases.

Note: This will select any test case starting with test_001 or test_some_other_test . Eg if you have test case test_case0012 it will also be selected

Source Link
supamaze
  • 9.1k
  • 2
  • 12
  • 11
Loading