Command-Line Options

In addition the command-line options for used to specify configuration values described in the previous chapter, maelstrom-pytest supports these command-line options:

--include and --exclude

The --include (-i) and --exclude (-x) command-line options control which tests maelstrom-pytest runs or lists.

These options take a test filter pattern. The --include option includes any test that matches the pattern. Similarly, --exclude pattern excludes any test that matches the pattern. Both options are allowed to be repeated arbitrarily.

The tests that are selected are the set which match any --include pattern but don't match any --exclude pattern. In other words, --excludes have precedence over --includes, regardless of the order they are specified.

If no --include option is provided, maelstrom-pytest acts as if an --include all option was provided.

--init

The --init command-line option is used to create a starter maelstrom-pytest.toml file. See here for more information.

--list

The --list command-line option causes maelstrom-pytest to print the tests that would normally be run, without actually running them.

This option can be combined with --include and --exclude.

Abbreviations

As discussed here, unambiguous prefixes can be used in patterns. This can come in handy when doing one-offs on the command line. For example, to run all tests in package foo with the marker mark:

maelstrom-pytest -i 'p.eq(foo) & m.c(mark)'