Running tests¶
In the quickstart guide, tests were run by
treating them as scripts and calling Tests.run()
directly on
the test suite. When your tests grow beyond a single file, however,
you may want to use the attest command line tool.
Usage¶
$ attest [options] [tests...] [key=value...]
The positional tests
are dotted names for modules or packages that
are scanned recursively for Tests
instances, or dotted names for
any other object that iterates over tests. If no position arguments are
provided, all packages in the working directory are scanned.
The key/value pairs are passed to the reporter constructor, after some command-line friendly parsing.
Options¶
-
-d
,
--debugger
¶
Enter pdb for failing tests.
-
-r
NAME
,
--reporter
=NAME
¶
Select reporter by name.
-
-l
,
--list-reporters
¶
List available reporters.
-
-n
,
--no-capture
¶
Don’t capture stderr and stdout.
-
--full-tracebacks
¶
Don’t clean tracebacks.
-
--fail-fast
¶
Stop at first failure.
-
--native-assert
¶
Don’t hook the assert statement.
-
-p
FILENAME
,
--profile
=FILENAME
¶
Enable tests profiling and store results in filename.
-
-k
,
--keyboard-interrupt
¶
Let KeyboardInterrupt exceptions (CTRL+C) propagate.
-
--version
¶
Show program’s version number and exit.
-
-h
,
--help
¶
Display a help message and exit.