py.test

Langue: en

Autres versions - même langue

Version: feb\&. 25, 2010 (ubuntu - 24/10/10)

Section: 1 (Commandes utilisateur)

NAME

py.test - pylib test runner

SYNOPSIS

py.test [option] [query] [filenames of tests...]

DESCRIPTION

This manual page documents briefly the py.test command.

This manual page was written for the Debian distribution because the original program does not have a manual page. Instead, it has documentation in html available in /usr/share/doc/python-codespeak-lib/py/doc/test.html.

py.test is a program that runs tests in a module or directory specified on the command line. It looks for functions and methods with names starting with 'test_' and run those methods. Assertions about test outcomes are done via the standard 'assert' statement.

OPTIONS

These programs follow the usual GNU command line syntax, with long options starting with two dashes (`-'). A summary of options is included below. This list may however be incomplete as test suits and aditional plugins can add more options.

-h --help

Displays a help message including all the available options.

-x --exitfirst

exit instantly on first error or failed test.

-k KEYWORD

only run test items matching the given space separated keywords. precede a keyword with '-' to negate. Terminate the expression with ':' to treat a match as a signal to run all subsequent tests.

--capture=method

set capturing method during tests: fd (default)|sys|no.

-s

shortcut for --capture=no.

--pdb

start pdb (the Python debugger) on errors.

-v --verbose

increase verbosity.

-l --showlocals

show locals in tracebacks (disabled by default).

--report=opts

show more info, valid: skipped,xfailed

--tb=style

traceback verboseness (long/short/no).

--fulltrace

don't cut any tracebacks (default is to cut).

--funcargs

show available function arguments, sorted by plugin

--pastebin=mode

send failed|all info to Pocoo pastebin service.

--junitxml=path

create junit-xml style report file at given path.

--collectonly

only collect tests, don't execute them.

--ignore=path

ignore path during collection (multi-allowed).

--confcutdir=dir

only load conftest.py's relative to specified dir.

--doctest-modules

run doctests in all .py modules

--doctest-glob=pat

doctests file matching pattern, default: test*.txt

--basetemp=dir

base temporary directory for this test run.

--version

display py lib version and import information.

-p PLUGINS

load the specified plugin after command line parsing.

--traceconfig

trace considerations of conftest.py files.

--nomagic

don't reinterpret asserts, no traceback cutting.

--debug

generate and show debugging information.

--help-config

show available conftest.py and ENV-variable names.

--no-assert

disable python assert expression reinterpretation.

--genscript=path

create standalone py.test script at given target path.

-f --looponfail

(requires xdist plugin) run tests, re-run failing test set until all pass.

-n numprocesses

(requires xdist plugin) shortcut for '--dist=load --tx=NUM*popen'

--boxed

(requires xdist plugin) box each test run in a separate process.

--dist=distmode

(requires xdist plugin) set mode for distributing tests to exec environments. each: send each test to each available environment. load: send each test to available environment. (default) no: run tests inprocess, don't distribute.

--tx=xspec

(requires xdist plugin) add a test execution environment. some examples: --tx popen//python=python2.5 --tx socket=192.168.1.102:8888 --tx ssh=user@codespeak.net//chdir=testcache

-d

(requires xdist plugin) load-balance tests. shortcut for '--dist=load'

--rsyncdir=dir1

(requires xdist plugin) add directory for rsyncing to remote tx nodes.

AUTHOR

This manual page was written by Alexandre Fayolle afayolle@debian.org for the Debian system (but may be used by others). Permission is granted to copy, distribute and/or modify this document under the terms of the GNU General Public License, Version 2 any later version published by the Free Software Foundation.

On Debian systems, the complete text of the GNU General Public License can be found in /usr/share/common-licenses/GPL.

AUTHORS

Alexandre Fayolle <afayolle@debian.org>

Author.

Adam Schmalhofer <Adam.Schmalhofer@gmx.de>


Copyright © 2007, 2010 Alexandre Fayolle, Adam Schmalhofer, Holger Krekel