refactoring how nodeid's are constructed. They now are always
relative to the "common rootdir" of a test run which is determined by
finding a common ancestor of all testrun arguments.
--HG--
branch : issue616
updated plugin index docs. Thanks Bruno Oliveira.
fix issue557: with "-k" we only allow the old style "-" for negation
at the beginning of strings and even that is deprecated. Use "not" instead.
This should allow to pick parametrized tests where "-" appeared in the parameter.
CWD outside a test package pytest would get fixture discovery wrong.
Thanks to Wolfgang Schnerring for figuring out a reproducable example.
--HG--
branch : conftest-nodeid
The new "--tb=auto" option (default) will only display long tracebacks
for the first and last entry. You can get the old behaviour of printing
all entries as long entries with "--tb=long". Also short entries by
default are now printed very similarly to "--tb=native" ones.
Without this if a session scoped fixture fails it's setup it will
be re-tried each time it is requested. Especially in case of
skip or failure exceptions this can be undesirable, but caching
makes sense for all exceptions.
If the type is not checked then an incomprehensible error will occur
later. This enforces the type and raies the same exception/msg as
CPython does in that case.
Docstring unmodified, just re-justified for pep8 compat.
Such reference cycles unnecessarily cause Python interpreter not to garbage
collect the objects referenced in those cycles as soon they could be collected,
and in turn cause the tests to use more memory than is strictly necessary.
--HG--
branch : break_ExceptionInfo_reference_cycles
use the original stream.
- avoid resetting capture FDs/sys.stdout for each test by keeping capturing
always turned on and looking at snapshotted capturing data during runtest
and collection phases.
Made it clearer that clearing such references is not mandatory and is only an
optional step which may help the Python interpreter speed up its garbage
collection.
--HG--
branch : document_ExceptionInfo_ref_cycle
pytest.raises() returns an ExceptionInfo object which, if a local reference is
made to it, forms a reference cycle:
ExceptionInfo
--> exception
--> stack frame raising the exception
--> current stack frame
--> current local variables
--> Exception Info
Such a reference cycle would then prevent any local variables in the current
stack frame, or any of its child stack frames involved in the same reference
cycle, from being garbage collected until the next reference cycle garbage
collection phase. This unnecessarily increases the program's memory footprint
and potentially slows it down.
This situation is based on a similar one described in the official 'try'
statement Python documentation for locally stored exception references.
--HG--
branch : document_ExceptionInfo_ref_cycle