Coggle requires JavaScript to display documents.
# test_addition.py import slash def test_addition(): pass
$ slash run test_additon.py
-v: increased -q: decreased
$ slash run -f file1.txt -f file2.txt
# my_suite_file.txt # This is the first test file /path/to/test.py # The second test file /path/to/other_test.py # You can repeat second test many time /path/to/other_test.py
$ slash run -k substr /path/to/tests
$ slash run -k 'not failing_' /path/to/tests
$ slash run -k 'not failing_ and components' /path/to/tests
$ slash run -o path.to.config.value=20 ..
$ slash run -i
$ slash resume -vv <session id>
$ slash return -vv <session id>
@slash.parmetrize('x', [1, 2, 3]) def test_something(x): pass
@slash.tag('dangerous') def test_something() ...
dangerous = slash.tag('dangerous') ... @dangerous def test_something(): ...
@slash.tag('covers', 'requirement_1294') def test_something(): ...
$ slash run tests -k dangerous
$ slash run test -k tag:dangerous
$ slash run tests -k 'microwave and power and not tag:dangerous'
$ slash run test -k covers=requirement_1294 OR $ slash run test -k tag:covers=requirement_1294
import slash @slash.fixture def microwave(): command ... command
@slash.fixture def micorwave(this): returned = Microwave() this.add_cleanup(returned.turn_off) return returned
@slash.fixture def heating_plate(microwave): return other_function(microwave)
def test_heating_plate_usage(microwave, heating_plate): # we can be sure that heating_plate matches # the micorwave, since 'micowave' will return # the same value for the test and for the fixture
$ slash run /path/to/tests --with-timedsession --duration DURATION Options for --with-timedsession: --duration DURATION: session duration after which all new test will not be executed. i.e., '30s' or '36h' or '3d6h30m' https://github.com/wroberts/pytimeparse
$ slash run /path/to/tests --repeat-all=NUM_TIMES Repeat all suite a specified amount of times
$ slash run /path/to/test --with-timedsession -duration DURATION --repeat-all=NUM_TIMES This combine to let the test run to the limit which is reached first: limit of duration or limit of repeat time