Commit Graph

75 Commits

Author SHA1 Message Date
Bruno Oliveira 530b0050b4 Improve TestReport.sections docs a bit
Related to #1790
2016-08-03 21:57:58 -03:00
Bruno Oliveira ff296fd541 Add capstdout and capstderr attrs to TestReport
Related to #1790
2016-08-03 21:49:43 -03:00
Bruno Oliveira 08002ab75a Add longreprtext property to TestReport objects
Related to #1790
2016-08-03 21:49:28 -03:00
Steffen Allner b650c3c118 Implement --setup-show cli flag
to also be able to see fixture setup with normal test execution.
2016-07-03 22:30:51 +02:00
Vasily Kuznetsov 1a5e530b98 Fix capturing with --setup-only/--setup-plan 2016-06-23 10:23:04 +02:00
Vasily Kuznetsov 61992b4e22 Implement --setup-plan option 2016-06-22 16:45:36 +02:00
Vasily Kuznetsov 5e0d78f4f1 Fix .format string failures on python 2.6 2016-06-22 14:53:37 +02:00
Vasily Kuznetsov 2c5c4f3f78 Add printing of fixture dependencies 2016-06-22 12:54:36 +02:00
Vasily Kuznetsov 6874c3a3cc Factor setuponly code out of runtestprotocol(). 2016-06-22 11:09:54 +02:00
Steffen Allner 499c9551c8 Implement working version of --setuponly 2016-06-22 09:42:45 +02:00
Roman Bolshakov 89df701ae9 Comment a workaround for #1485. 2016-03-27 13:15:56 +03:00
Roman Bolshakov a736e26734 Merge remote-tracking branch 'pytest-dev/master' into fix-issue-138 2016-03-20 01:04:22 +03:00
Roman Bolshakov fbc5ba08d9 Fix issue #138 2016-03-20 01:02:17 +03:00
Bruno Oliveira 5d4703852e Add test when using native strings with non-ascii chars 2016-03-05 19:34:15 -03:00
Bruno Oliveira 24d3e01548 pytest.fail with non-ascii characters raises an internal pytest error
Fix #1178
2016-03-05 16:09:01 -03:00
Bruno Oliveira a912d3745b Moved py.code code over to py.test
Fix #103
2016-01-25 23:18:04 -02:00
Bruno Oliveira 8b61a332ba Merge remote-tracking branch 'bukzor/features-merge-master' into features 2015-12-10 19:03:55 -02:00
David Vierra fbac936596 Add -rp and -rP options to report passing tests.
-rP is an alternative to `-s` for viewing the output of passing tests.
This causes the captured stdout/stderr of passing tests to be output in
the same way as that of failing tests.

-rp adds a simple one-line-per-test summary for passing tests.

Neither option is included by -ra.

Additional changes to `pytest_capturelog` and `pytest_catchlog` are
needed for this option to also output captured logs: They must be
changed to use `rep.sections.add` instead of `rep.longrepr.addsection`,
and to add these additional sections even if the test passes, since
passing tests don't seem to have a `longrepr` at report time.
2015-12-07 11:32:56 -10:00
Jeff Widman 6be6798cdf Fix spelling: explicitely --> explicitly 2015-12-01 01:41:47 -08:00
Florian Bruhin c10f483b9f Don't hardcode 'std' for captured stdout/stderr.
This will make Item.add_report_sect more usable for plugins.
See https://github.com/eisensheng/pytest-catchlog/pull/7
2015-09-22 20:29:16 +02:00
holger krekel 5af262daa3 fix flakes problem, configure devpi upload to always upload wheels and sdist 2015-09-15 12:28:09 +02:00
holger krekel 16720b96b4 fix a few issues with pytest-2.7 branch and bump version number
- importorskip: skip a test if we have a minversion but cannot parse
  version numbers due to pkg_resources not present
- make runner tests work with latest xdist
2015-09-15 12:17:52 +02:00
Eric Hunsberger d104487282 importorskip: Allow non-integer version strings
Use `pkg_resources.parse_version` to parse version strings.
This can handle 'dev', 'rc', alpha and beta version strings,
among others.
2015-07-24 12:34:06 -04:00
Almar Klein 9726fafa98 allow postmortem debugging on failed test 2015-03-21 09:26:35 +01:00
Bruno Oliveira 5603a0cd4b Removing py.std usage from _pytest 2014-07-31 19:13:40 -03:00
Jurko Gospodnetić 9263f30c88 use py.builtin.callable instead of raw callable in _pytest/runner.py
This is consistent with how callable() is called from the rest of pytest code
(see _pytest/nose.py & _pytest/python.py) plus, as a nice side-effect, it
makes pytest work correctly on Python 3.1.

--HG--
branch : python 3.1 fix
2014-05-13 21:05:53 +02:00
holger krekel 7b63fa5966 merge in current default 2014-03-27 13:57:54 +01:00
schlamar 94b1ce65c6 Fixed race condition with SkipTest when module not in sys.modules on collection. 2014-03-14 14:04:54 +01:00
holger krekel 9777703e03 - turn on capturing before early conftest loading and make terminal writer
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.
2014-03-14 12:49:36 +01:00
holger krekel b47fdbe0a7 remove externally setting and dealing with "item.outerr" from capturing in favor of a direct interface for adding reporting sections to items.
* * *
refactor makereport implementation to avoid recursion with __multicall__
2014-03-14 12:49:34 +01:00
holger krekel 4622c28ffd setupstate.addfinalizer(): fix docstring and remove related unit test not covering functional reality 2014-01-26 12:44:21 +01:00
Jurko Gospodnetić 9fb2079458 replace py.test module references with pytest
The only remaining 'py.test' references are:
 * those referring to the 'py.test' executable
 * those in code explicitly testing py.test/pytest module compatibility
 * those in old CHANGES documentation
 * those in documentation generated based on external data
 * those in seemingly unfinished & unmaintained Japanese documentation

Minor stylistic changes and typo corrections made to documentation next to
several applied py.test --> pytest content changes.
2014-01-18 12:31:33 +01:00
holger krekel dbfbc2b222 add a skip benchmark file (from issue400). 2013-12-07 19:11:37 +01:00
holger krekel fc073cb81c fixed version comparison in pytest.importskip(modname, minverstring) 2013-11-21 13:53:04 +01:00
Floris Bruynooghe 6686c67a41 Re-raise the first exception instead of the last
This will make more sense if multiple fixtures depend on each other.
It would be better if all exceptions could be shown however.

Also depend on python 2.5+ exception hierarchy and use sys module
directly.
2013-11-21 01:15:24 +00:00
Floris Bruynooghe 72752165df Ensure all finalizations are run when one fails
Fixes issue287.
2013-11-19 17:26:18 +00:00
holger krekel 94ee37cdb3 - fix issue181: --pdb now also works on collect errors. This was
implemented by a slight internal refactoring and the introduction
  of a new hook ``pytest_exception_interact`` hook.

- fix issue341: introduce new experimental hook for IDEs/terminals to
  intercept debugging: ``pytest_exception_interact(node, call, report)``.
2013-09-06 11:56:04 +02:00
holger krekel ca7c1f5d8e merge pull request #27: correctly handle nose.SkipTest during collection. Thanks
Antonio Cuni, Ronny Pfannschmidt.  I did a few tweaks to the test and the
activation (depending on if unittest is imported at all).
2013-08-16 11:33:58 +02:00
Anthon van der Neut 15ec5a898c moving from optparse to argparse. Major difficulty is
that argparse does not have Option objects -> added class Argument
Needed explicit call of MyOptionParser.format_epilog as argparse
does not have that. The parse_arg epilog argument wraps the text,
which is not the same (could be handled with a special formatter).

- parser.parse() now returns single argument (with positional args in
  .file_or_dir)
- "file_or_dir" made a class variable Config._file_or_dir and used in help and tests
- added code for argcomplete (because of which this all started!)

addoption:
- if option type is a string ('int' or 'string', this converted to
  int resp. str
- if option type is 'count' this is changed to the type of choices[0]

testing:
- added tests for Argument
- test_mark.test_keyword_extra split as ['-k', '-mykeyword'] generates argparse
  error test split in two and one marked as fail
- testing hints, multiline and more strickt (for if someone moves format_epilog
  to epilog argument of parse_args without Formatter)
- test for destination derived from long option with internal dash
- renamed second test_parseopt.test_parse() to test_parse2 as it was
  not tested at all (the first was tested.)

--HG--
branch : argparse
2013-07-25 15:33:43 +02:00
maho 9e3cd03721 #299 - polishing 2013-05-08 17:01:20 +02:00
hg d2dc797779 #299 2013-05-05 22:15:06 +02:00
holger krekel b2cb93e06d allow re-running of a test item (as exercised by the
pytest-rerunfailures plugins) by re-initializing and removing
request/funcargs information in runtestprotocol() - which is a slightly
odd place to add funcarg-related functionality but it allows all
pytest_runtest_setup/teardown hooks to properly see a valid
request/funcarg content on test items.
2013-04-22 10:35:48 +02:00
Benjamin Peterson 65c69a34ac python 2.4 compatibility 2013-03-16 20:08:01 -07:00
Antonio Cuni 37c47155e0 correctly handle nose.SkipTest during collection 2013-03-14 16:10:33 +01:00
Ronny Pfannschmidt 570688f701 ensure OutcomeExceptions like skip/fail have initialized exception attributes 2013-01-27 02:06:19 +01:00
holger krekel fb3af07ef4 try to move docs to a more releasable state, also refine
release announce and a few coding bits
2012-10-09 14:35:17 +02:00
Ronny Pfannschmidt 9568ff3b23 backout, the _memoizedcall change worked only due to a local effect 2012-09-24 11:36:24 +02:00
Ronny Pfannschmidt 6e5f491a42 get rid of _memoizedcall - we dont really need it anymore 2012-09-24 11:26:38 +02:00
holger krekel 41ad7dbae1 fix issue185 monkeypatching time.time does not cause pytest to fail 2012-09-01 09:58:10 +02:00
holger krekel d68c65b493 minimize active parametrized non-function scoped resources by
- re-ordering at collection time
- modifying setup/teardown
2012-07-30 10:46:03 +02:00