custom IPython shell

An extended shell for test selection


Bases: IPython.terminal.embed.InteractiveShellEmbed

Custom ip shell with a slightly altered exit message


Sets up the command history, and starts regular autosaves.


A separate history db is allocated for this plugin separate from regular shell sessions such that only relevant commands are retained.


Handle interactive exit. This method calls the ask_exit callback and if applicable prompts the user to verify the current test selection

class, **kwargs)[source]

Bases: IPython.core.magic.Magics

Custom magics for performing multiple test selections within a single session


Evalutate line in the embedded ns and return result


Add tests from a test set to the current selection.


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 ‘:’.


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 all currently selected test by pretty printing to the console.


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.


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.