Commit Graph

512 Commits

Author SHA1 Message Date
Ronny Pfannschmidt 4c885cf0d2 hopefully final win32 fix for the junitxml path expansion 2011-05-28 17:36:38 +02:00
Ronny Pfannschmidt 70dc7a976d dont wrap comparisation paths in py.path.local for the junitxml tests, since missing $HOME causes issues else 2011-05-28 16:52:05 +02:00
holger krekel 410438f187 fix issue43 - better tracebacks for unexpected exceptions in doctests 2011-05-28 14:38:15 +02:00
holger krekel 8dc4e732f0 fix issue47 - fix time-per-test timing output for junitxml 2011-05-28 14:03:10 +02:00
Ronny Pfannschmidt 56b40ebd75 use os.path.expanduser/expandvars on the junitxml path for convience, fixes #44 2011-05-27 07:54:03 +02:00
Benjamin Peterson 971f34147a test that tests get rewritten 2011-05-26 20:06:11 -05:00
Benjamin Peterson 7cf8afef47 cause configure hooks to be called 2011-05-26 18:10:49 -05:00
Benjamin Peterson dd199d255c move _setupstate into session 2011-05-26 17:08:56 -05:00
Benjamin Peterson c4d761fe99 these tests should cause pytest_configure to be called 2011-05-26 16:50:04 -05:00
Benjamin Peterson d438a0bd83 introduce --assertmode option 2011-05-26 14:34:27 -05:00
Benjamin Peterson 250160b4b0 refactor explanation formatting things into their own module 2011-05-26 12:01:34 -05:00
Benjamin Peterson f423ce9c01 import assertion code from pylib 2011-05-25 17:54:02 -05:00
Benjamin Peterson 491c05cea7 create the _pytest/assertion package 2011-05-25 16:18:45 -05:00
Benjamin Peterson c0910abf2f account py3 range objects 2011-05-24 18:30:18 -05:00
Benjamin Peterson fa412675fc use py.builtin.exec_ 2011-05-24 18:28:05 -05:00
Benjamin Peterson 0bb84abca7 handle comparison results which raise when asked for their truth value 2011-05-24 18:15:08 -05:00
Benjamin Peterson f5decc90ca test that python loads our fake pycs 2011-05-24 17:52:17 -05:00
Benjamin Peterson 76cede83c0 add a way to disable assertion rewriting for a module 2011-05-24 17:30:35 -05:00
Benjamin Peterson 9c4f6791e5 give initial imports a reasonable lineno 2011-05-24 17:21:58 -05:00
Benjamin Peterson 7ba8fee3dc improve this test 2011-05-20 09:44:36 -05:00
Benjamin Peterson aae89cd021 correctly handle multiple asserts 2011-05-19 18:56:48 -05:00
Benjamin Peterson 9e6dfaefd9 place assertion imports after __future__ statements and docstrings 2011-05-19 16:53:13 -05:00
Benjamin Peterson c742e47de0 new assertion debugger which rewrites asserts before they are run 2011-05-18 15:31:10 -05:00
Ronny Pfannschmidt b6815538c5 introduce the pytest_configure_funcargs hook for better control on funcarg instanciation/configuration 2011-05-12 23:47:05 +02:00
holger krekel 942ae47cd1 tentatively use internal list for cleanups at unconfigure time - this helps reporting with partially executed pytest_configure() hooks 2011-04-17 12:20:13 +02:00
holger krekel 06ca7090f9 fix issue38 - nicer tracebacks on sessionstart/configure (and other internal/custom hook failures) 2011-04-17 12:20:11 +02:00
Floris Bruynooghe 1c1918eb22 Prevent null-characters from appearing in junitxml's output
The Jenkins XML parser does not deal with null-characters inside the
XML.  This replaces any null character with nothing in the XML output,
which makes no visual difference.
2011-04-16 00:09:25 +01:00
Floris Bruynooghe 60ff2e8529 Allow unicode characters in testdir.makepyfile()
On python2.x text arguments where passed through str, which meant only
ascii-encodable strings could be used.  This uses
py.builting._totext() to keep unicode until it is written out to the
file, which was already UTF-8 encoded.
2011-04-11 23:15:56 +01:00
holger krekel 3a9788fc6f fix missing reason/name information for skipped tests 2011-03-19 17:59:07 +01:00
holger krekel ed6d2537bc fix issue33 - no collection error for classes prefixed "test" deriving from object 2011-03-16 16:36:18 +01:00
holger krekel 1a7c6ecc42 fix slightly wrong verbose output for non subclasses on windows 2011-03-08 13:37:00 +01:00
holger krekel f2670651b3 half the overhead for calling a test function by introducing some caching 2011-03-07 18:28:45 +01:00
holger krekel c552b58dc5 fix issue27 - --collectonly and -k keyword selection now work together.
internally, collectonly and terminal reporting has been unified.
2011-03-06 18:32:00 +01:00
holger krekel 18e784c9c9 re-introduce pytest._fillfuncargs - it's actually used by oejskit,
added a test documenting this.
2011-03-06 08:56:58 +01:00
Ronny Pfannschmidt a6c518e68c unittest plugin: prune __unittest marked modules from traces 2011-03-05 17:49:51 +01:00
holger krekel 7e44c38570 avoid this test on pypy because syntax errors on pypy-1.4.1 are not precise it seems 2011-03-05 14:59:06 +01:00
holger krekel bfe6e98abb don't expose _fillfuncargs (no clue why it ever was exposed) 2011-03-05 14:29:10 +01:00
holger krekel 07cee24122 avoid deprecation warnings for our internal accesses 2011-03-05 14:16:27 +01:00
holger krekel 318e8a404b fix and improve error reporting for parametrizing funcargs (originally reported by antlong) 2011-03-05 12:11:35 +01:00
holger krekel 070c73ff2f fix issue30 (the second time)
put module globals into namespace for xfail and skipif expressions
2011-03-03 23:22:55 +01:00
holger krekel 682773e0cb fix issue30 - better handling and reporting of errors in xfail expressions 2011-03-03 12:19:17 +01:00
holger krekel 6f3b84da9f fix issue 28 - setup_method now works with pytest_generate_tests 2011-03-02 18:03:43 +01:00
Floris Bruynooghe 2f2586af72 Fix pytest_assertrepr_compare on python3 (issue24)
The maxsize argument must be an integer and the devision syntax changed
between python2 and python3.
2011-02-15 23:24:18 +00:00
holger krekel 74b9ebc1cd accept a left out "()" for ids on command line for better compatibility with pytest.vim 2011-02-07 11:09:42 +01:00
holger krekel 3004fe3915 fix the last committed laxation of a test 2011-02-04 23:20:27 +01:00
holger krekel eb225456d7 laxer test for also passing it with pypy 2011-02-04 22:51:05 +01:00
holger krekel 762ea71f67 fix error reporting issue when a "pyc" file has no relating "py" 2011-01-27 21:11:21 +01:00
holger krekel adacd3491d fix test related to "not in" 2011-01-27 11:36:12 +01:00
holger krekel d8d88ede65 refine and unify initial capturing - now works also if the logging module
is already used from an early-loaded conftest.py file (prior to option parsing)
2011-01-18 12:51:21 +01:00
holger krekel b8f0d10f80 fix a pypy related regression - re-allow self.NAME style collection tree customization 2011-01-18 12:47:31 +01:00
holger krekel aea4d1bd7a fix regression with yield-based tests (hopefully) 2011-01-14 13:30:36 +01:00
holger krekel 88cfaebbcb fix issue12 - show plugin versions with "--version" and "--traceconfig" and also document how to add extra information to reporting test header 2011-01-12 19:39:36 +01:00
holger krekel 4445685285 pypy doesn't neccessarily honour -OO it seems, let's not test assertions there. 2011-01-12 18:57:40 +01:00
holger krekel 1b3fb3d229 fix issue15 - tests for python3/nose-1.0 combo work now 2011-01-11 17:27:34 +01:00
holger krekel 170c78cef9 remove same-conftest.py detection - does more harm than good
(see mail from Ralf Schmitt on py-dev)
2011-01-11 15:54:47 +01:00
Floris Bruynooghe 8631c1f57a Add "not in" to detailed explanations
This simply uses difflib to compare the text without the offending
string to the full text.

Also ensures the summary line uses all space available.  But the
terminal width is still hardcoded.
2010-12-10 01:03:26 +00:00
holger krekel 821f493378 check docstring at test time instead of runtime, improve and test warning on assertion turned off (thanks FND for reporting) 2010-12-09 11:00:31 +01:00
holger krekel a15983cb33 rather named the new hook cmdline_preparse 2010-12-07 12:34:18 +01:00
holger krekel 9ab256c296 make getvalueorskip() be hidden in skip-reporting. also bump version. 2010-12-07 12:18:24 +01:00
holger krekel 7db9e98b55 introduce a pytest_cmdline_processargs hook to modify/add dynamically to command line arguments. 2010-12-07 12:14:12 +01:00
holger krekel fc4f72cb1f fix issue7 - assert failure inside doctest doesn't prettyprint
unexpected exceptions are now reported within the doctest failure
representation context.
2010-12-06 19:00:30 +01:00
holger krekel 513482f4f7 fix issue9 wrong XPass with failing setup/teardown function of xfail marked test
now when setup or teardown of a test item/function fails and the test
is marked "xfail" it will show up as an xfail-ed test.
2010-12-06 18:20:47 +01:00
holger krekel 2e80512bb8 fix issue8 : avoid errors caused by logging module wanting to close already closed streams.
The issue arose if logging was initialized while capturing was enabled
and then capturing streams were closed before process exit, leading
to the logging module to complain.
2010-12-06 16:56:12 +01:00
holger krekel c7531705fc refine plugin registration, allow new "-p no:NAME" way to prevent/undo plugin registration 2010-12-06 16:54:42 +01:00
holger krekel b622c85bbf last changes, preparing 2.0.0 2010-11-25 20:06:42 +01:00
holger krekel f6894ce550 fix some more trial/unittest related bits, particularly allow todo/skip items,
now we can run a large fraction of twisted's own test suite, mostly not those
that depend on the exact Failure() semantics (e.g. frame objects not being around
after gc.collect() but py.test kills them only slightly later anyway)
2010-11-25 15:48:59 +01:00
holger krekel 4cb2c74159 introduce new discovery mechanism
XXX experiment with using it before introducing it or wait
for feature request
2010-11-24 22:01:04 +01:00
holger krekel 539f828cdd also accept non-pytrace pytest.fail() call in setup/teardown methods 2010-11-24 16:43:55 +01:00
holger krekel c36b20b137 allow setup_method/teardown_method to be mixed into unittest cases, reshuffle tests a bit 2010-11-24 16:17:49 +01:00
holger krekel 10d4544267 teach trial support code to throw separate errors/failures for setup/call/teardown 2010-11-24 14:35:04 +01:00
Maciej Fijalkowski ff27d299cc Finish the test 2010-11-24 15:06:40 +02:00
Maciej Fijalkowski 233baecd2d A test for trial 2010-11-24 14:54:56 +02:00
holger krekel 9be1cd8007 fix #6 : allow skip/xfail/pdb with trial by hacking the raw exception info out from trial 2010-11-24 11:48:55 +01:00
holger krekel 840eed28be allow setup_class in unittest test cases 2010-11-24 00:23:39 +01:00
holger krekel 4fa7a2e8ce fix #128 show tracebacks for all failures and errors that haven't beed PDB-debugged 2010-11-23 16:10:47 +01:00
holger krekel 695bffc83d refine unittest support to also work with twisted trial test cases better by
introducing a slightly hackish way to report a failure upstream
2010-11-23 15:42:23 +01:00
holger krekel 6e6b0ab5d9 nice-fy error reporting of self-tests 2010-11-22 15:20:18 +01:00
holger krekel 0357d3afda refine initialization and collection reporting, introduce a progress bar 2010-11-22 11:59:56 +01:00
holger krekel bc42cf8ffb add a way to mark hooks as "tryfirst" or "trylast" to influence its position in a hook chain.
Use 'tryfirst' for capturing hooks so they can start capturing as early as possible,
including when conftests add output in runtest_setup hooks.
2010-11-21 23:17:59 +01:00
holger krekel f456e376b9 refine tmpdir handling and docs
- clear tmpdir specified with --basetemp
- remove config.mktmp and config.getbasetemp methods
2010-11-21 17:43:18 +01:00
holger krekel bd5a9ba392 fix: mark.* objects are now immutable as long as they are not an attribute on a function, enables usage like this::
xfail = pytest.mark.xfail

    @xfail
    def test_func1():
        pass

    @xfail(reason="123")
    def test_func2():
        pass

where previously test_func1 and test_func2 would wrongly share the same reason
because the xfail object was modified in place.
2010-11-20 20:17:38 +01:00
holger krekel 9a21a81740 add ability to use scope="class" in request.cached_setup() calls 2010-11-20 18:03:18 +01:00
holger krekel 582486d531 refine docs and docstrings, fix some small bits here and there while doing that. 2010-11-18 14:56:16 +01:00
holger krekel a698465487 streamline docs, especially use "import pytest" and "pytest.*" in python code examples instead of "import py" and "py.test.*". 2010-11-17 22:12:16 +01:00
holger krekel 2a825169b2 fix doctest IDs, also fix tree traversal and remove dead code 2010-11-17 18:24:28 +01:00
holger krekel acd286f82f run doctests in .txt/.rst files directly specified on command line irrespective of "test*.txt" pattern. 2010-11-17 14:33:21 +01:00
holger krekel fb102a2ddb bump version and comment out ignore-testclass-if-unittest-module-feature 2010-11-17 12:21:24 +01:00
holger krekel 82ba645a2e fix skip reporting over distributed testing. if we have a "skip" report
rep.longrepr will now be a 3-tuple (path, lineno, message)
2010-11-13 21:03:28 +01:00
holger krekel 076e03e90f also un-nest test directory 2010-11-13 11:30:40 +01:00
holger krekel 929291775e flat is better than nested (cont'd):
- pytest.py is new module, making "python -m pytest" work always
- _pytest/*.py now contains core.py, hookspec and the plugins, no sub packages
2010-11-13 11:10:45 +01:00
holger krekel 2e4e9eb745 internally use pytest.* instead of ``py.test.*`` in many places.
make sub namespace names 'collect' and 'cmdline' available on pytest directly
2010-11-13 09:05:11 +01:00
Benjamin Peterson d44ff035d0 add coding for py3 2010-11-08 16:48:15 -06:00
holger krekel 55dff651f4 refine initilization: read config also from a "pytest.ini" file if exists
and revert earlier commandline option and group ordering change.
2010-11-07 16:10:22 +01:00
holger krekel 6461295ab4 probably the last major internal cleanup action: rename collection to
session which now is the root collection node.  This means that
session, collection and config objects have a more defined
relationship (previously there was no way to get from a collection
node or even from a runtest hook to the session object which
was strange).
2010-11-07 10:19:58 +01:00
holger krekel 582a2100b1 fix test, bump version 2010-11-07 07:14:50 +01:00
holger krekel d9ad2e7cce some python3 related fixes 2010-11-07 01:10:15 +01:00
Benjamin Peterson 8716b391c7 PYTHONDONTWRITEBYTECODE might not be set 2010-11-06 18:36:24 -05:00
holger krekel 885c7ce281 some fixes for --pyargs situations and the docs, remove wrongly added test 2010-11-07 00:22:16 +01:00
holger krekel d0ac4135a2 introduce an option that avoids discovery of classes other than unittest.TestCase in modules
importing unittest.
2010-11-06 23:45:48 +01:00
holger krekel 707775dcfa introduce new --testpkg importpath option, add more meat to draft release announcement 2010-11-06 22:17:33 +01:00