custom IPython shell¶
An extended shell for test selection
-
class
interactive.shell.
PytestShellEmbed
(**kw)[source]¶ Bases:
IPython.terminal.embed.InteractiveShellEmbed
Custom ip shell with a slightly altered exit message
-
class
interactive.shell.
SelectionMagics
(shell=None, **kwargs)[source]¶ Bases:
IPython.core.magic.Magics
Custom magics for performing multiple test selections within a single session
-
add
(line)[source]¶ Add tests from a test set to the current selection.
Usage:
add tt : add all tests in the current tree add tt[4] : add 5th test in the current tree add tt.tests[1:10] : add tests 1-9 found under the ‘tests’ module
-
remove
(line, delim=', ')[source]¶ Remove tests from the current selection using a slice syntax using a ‘,’ delimiter instead of ‘:’.
Usage:
remove : remove all tests from the current selection remove -1 : remove the last item from the selection remove 1, : remove all but the first item (same as [1:]) remove ,,-3 : remove every third item (same as [::-3])
-
show
(test_set)[source]¶ Show all currently selected test by pretty printing to the console.
Usage:
show: print currently selected tests
-
cache
(line, ident='pytest/interactive')[source]¶ Store a set of tests in the pytest cache for retrieval in another session.
Usage:
cache: show a summary of names previously stored in the cache.
cache del <name>: deletes the named entry from the cache.
cache add <name> <target>: stores the named tests as target name.
-