Ronny Pfannschmidt
0c8e71faa5
simplify the loop in Node.listchain
2011-12-01 19:36:44 +01:00
holger krekel
50c9e3f654
improve parametrize() docs
2011-11-19 23:45:05 +00:00
holger krekel
6b4e6eee09
improve release announcement, shift and fix examples a bit. Bump version to 2.2.0
2011-11-18 18:32:11 +00:00
holger krekel
f7648e11d8
another try to properly fix durations sorting (still producing sometimes failing tests, apparently when two durations of a test report are identical)
2011-11-18 17:59:52 +00:00
holger krekel
7bb7d1205c
finally fixing a bug that resulted in sometimes-failing duration tests (doh)
2011-11-18 17:35:23 +00:00
holger krekel
a1d41c6811
remove a hack that isn't needed because runtestprotocol now memorizes pending teardowns and thus dist-testing has "exact" teardowns as well
2011-11-18 16:58:21 +00:00
holger krekel
58e0301f87
fix compat with testcases from trial-11.1.0
2011-11-18 16:34:46 +00:00
holger krekel
a5e7b2760d
fix issue90 - perform teardown after its actual test function/item. This is implemented by modifying the runtestprotocol to remember "pending" teardowns and call them before the setup of the next item.
2011-11-18 16:01:29 +00:00
Alfredo Deza
efe438d3e8
add padding to durations in rep.when
2011-11-18 09:59:39 -05:00
holger krekel
ec0565fac5
introduce metafunc.parametrize() and @pytest.mark.parametrize with examples. deprecate metafunc.addcall()
2011-11-17 11:09:21 +00:00
holger krekel
8f55425898
fix issue87 - pastebin option now works with python3
2011-11-15 13:35:06 +00:00
holger krekel
a51e52aee3
fix issue89 apply Daniel Nouri's patch to doctest/--pdb interaction.
2011-11-15 13:28:22 +00:00
Ronny Pfannschmidt
69dfc75572
test and fix pastebin xmlrpc import name missmatch, fixes #87
2011-11-14 17:51:12 +01:00
holger krekel
36c42b5c15
introduce a new -m mark_expression option
2011-11-11 23:02:06 +00:00
holger krekel
bc8ee95e72
add ini-file "markers" option and a cmdline option "--markers" to show defined markers. Add "skipif", "xfail" etc. to the set of builtin markers shown with the --markers option.
2011-11-11 22:56:11 +00:00
holger krekel
979dfd20f2
add a method to the config object to dynamically add a value to an (line-type) ini-value
2011-11-11 22:56:08 +00:00
holger krekel
7f7589afa9
skip pexpect tests on darwin
2011-11-11 21:33:45 +00:00
holger krekel
4f01cda2a7
fix formatting
2011-11-09 11:04:37 +00:00
holger krekel
99a1188287
simplify durations output, no percentage, no "remaining" bits
2011-11-08 20:57:19 +00:00
holger krekel
0b18b6094e
fix duration option in case of collection errors
2011-11-08 19:00:25 +00:00
holger krekel
ae53d04780
fix py3 compat
2011-11-08 18:37:08 +00:00
holger krekel
29bf205f3a
make --durations also show the execution times of setup/teardown calls. This requires a slight incompatibility - pytest_runtest_logreport now sees setup/teardown reports even if the tests passed.
2011-11-08 17:53:46 +00:00
holger krekel
3b9fd3abd8
introduce --durations=N showing slowest test executions
2011-11-08 17:20:56 +00:00
holger krekel
78438db752
fix py3 failure
2011-11-07 18:28:30 +00:00
holger krekel
a2f4a11301
refine lsof/FD leakage testing and rework test setup and some of pytest own tests. Note that the actual diff to non-test code is small. Also remove some redundant tests (introduced by a copy-paste-error apparently in test_mark.py).
2011-11-07 18:08:41 +00:00
holger krekel
077c468589
don't remove symlinks from temporary directory path - should help with some standard OSX setups
2011-11-06 19:34:02 +00:00
holger krekel
d4fe273b2f
fix FD leakage during pytest's own test run and add "--lsof" option to tox default test runs.
...
the leakage came down to a problematic bit of the stdlib logging module: it takes ownerships of stdout/stderr making it hard for pytest to implement clean capturing. The current work around is to add some extra code in the setup machinery of pytest's own tests which actually closes sub-FDs.
2011-11-06 15:40:17 +00:00
Ronny Pfannschmidt
761a95e542
fix some of my typos, thanks Arfrever
2011-10-27 07:38:44 +02:00
Ronny Pfannschmidt
2c230f910d
fix issue74 - propperly filter out missfit names in _tryconvertpyarg
2011-10-26 22:40:08 +02:00
holger krekel
346da57a8a
bump to version 2.1.3, add release announce, regen docs (with make regen)
2011-10-18 20:07:45 +02:00
Floris Bruynooghe
e2201fe3a9
Look up the pytest_assertrepr_compare hook for each test item
...
Before this was only done at the time the assertion plugin was loaded.
This lead to counter-intuitive behaviour where two subdirectories with
a pytest_assertrepr_compare hook in their conftest.py would not work,
only one would ever be used.
This defers assiging the _pytest.assertion.util._reprcompare function
until the item is loaded (pytest_runtest_setup) so that it can use the
hookrelay of the test item to find the appropriate
pytest_assertrepr_compare hook for the item.
This fixes issue #77 .
2011-10-16 11:51:15 +01:00
Benjamin Peterson
45b98d6e70
cast boolean thing to int to make py3.3 happy
2011-10-14 18:08:10 -04:00
Benjamin Peterson
29b4082b00
put the explanation generating code in the conditional fail body ( fixes #79 )
2011-10-14 16:26:13 -04:00
Ronny Pfannschmidt
6ac638ba87
add a reportchar for reporting errors, fixes #76
2011-09-29 23:44:26 +02:00
Ronny Pfannschmidt
f2512017ea
correctly handle zero length cmdline arguments
2011-09-25 23:26:49 +02:00
holger krekel
3bd3ba133f
fix issue75 - test failure on jython.
...
also experimentally enable more tests in the jython test env.
2011-09-25 07:40:43 +02:00
holger krekel
45afb1b7d1
fix issue67 - junitxml now contains correct durations. thanks ronny.
2011-09-24 15:15:51 +02:00
holger krekel
922a283f99
bump version
2011-09-24 14:13:24 +02:00
Ronny Pfannschmidt
ac9192e4f8
make call durations part of the test report
2011-09-23 10:53:03 +02:00
holger krekel
ad785a476c
going for 2.1.2 bug fix release
2011-09-23 07:30:44 +02:00
holger krekel
fb6fc673b8
don't try assertion rewriting on jython for now
2011-09-21 06:45:40 +02:00
Benjamin Peterson
2bc4065a00
rewrite file newlines when the python parser is picky
2011-09-20 17:53:07 -04:00
holger krekel
5c32421f2e
merge, bump version
2011-09-12 08:57:35 +02:00
Florian Mayer
0e05a4fbcf
Improve --pyargs.
...
Don't evaluate modules and do nto show 'module not found' if ImportError is
thrown in the module.
2011-09-01 16:19:16 +02:00
Benjamin Peterson
8675cf640d
every boolop operand must have it's own format context ( fixes #69 )
2011-08-30 10:34:21 -04:00
Benjamin Peterson
8b211983ff
clear instead of deleting temporary assertion variables
2011-08-30 00:24:57 -04:00
Benjamin Peterson
661a8a4a92
only use the last part of the module name in the filename ( fixes #68 )
2011-08-30 00:12:07 -04:00
Benjamin Peterson
abe080c6b4
use different caches for optimized and unoptimized code ( fixes #66 )
2011-08-29 10:13:00 -04:00
holger krekel
09933b8b04
bump to 2.1.1, regen examples, add release announcement
2011-08-20 18:37:00 +02:00
holger krekel
41b8a03b05
merge
2011-08-19 18:07:39 +02:00
holger krekel
fba2079292
bump version number, refine goodpractises wrt to importing test modules
2011-08-19 07:58:50 +02:00
Benjamin Peterson
9675b0f65c
factor out win32 checks
2011-08-18 18:15:30 -05:00
Benjamin Peterson
6ca3c980bf
same as 6e94b1809f67: ENOTDIR is ENOENT on windows
2011-08-18 14:49:17 -05:00
Benjamin Peterson
5bd34f8ecc
windows kicks up a ENOENT when a part of the path is not a dir
2011-08-18 14:39:57 -05:00
Ronny Pfannschmidt
7636dc76e0
support pytest.set_trace in collection
2011-08-01 10:53:37 +02:00
Benjamin Peterson
c5dee7b549
_make_rewritten_pyc doesn't need to return anything
2011-07-25 21:42:57 -05:00
Benjamin Peterson
643ab120f4
only try to create the __pycache__ dir (not a tree to it) fixes #60
...
Also, improve error handling surrounding __pycache__ creation.
2011-07-25 21:40:38 -05:00
Benjamin Peterson
2c4964d290
escape '%' in specialized comparison explanations ( fixes #63 )
2011-07-19 21:42:00 -05:00
holger krekel
43113f9a9d
add some debugging tracing to assertion rewriting to understand where failures (specifically issue60) come from.
2011-07-14 19:17:17 +02:00
holger krekel
650c3bcfde
enhance debug tracing: print trace tags at the end of message and forget about "prefix".
...
Always log to "pytestdebug.log" if "--debug" option is given.
also move related code to pytest_helpconfig plugin.
2011-07-14 19:11:50 +02:00
Benjamin Peterson
7576b3c7d0
fix assertion rewriting on calls with a double-star arg
2011-07-14 11:45:42 -05:00
Benjamin Peterson
85415135a4
merge heads
2011-07-13 13:34:24 -05:00
Benjamin Peterson
3cc8697744
respect sys.dont_write_bytecode and PYTHONDONTWRITEBYTECODE
2011-07-13 13:33:54 -05:00
holger krekel
703da22831
put systemout/systemerr to correct xml location
2011-07-13 18:47:27 +02:00
Benjamin Peterson
14ceaf2459
fix assertion rewriting in read-only directories (refs #60 )
2011-07-12 17:09:14 -05:00
holger krekel
f3bc197afb
fix #59 : provide better Jenkins stdout and stderr sections
2011-07-12 23:09:03 +02:00
holger krekel
709da3fe84
add benjamin's post to docs, up version, open changelog
2011-07-12 10:38:02 +02:00
Michał Bartoszkiewicz
6096aeca53
Fix a typo in assertion rewriting.
2011-07-11 11:57:47 +02:00
Benjamin Peterson
8cd68494bf
update assertion option names
2011-07-10 21:02:36 -05:00
Benjamin Peterson
bc66cd85b1
customize pyc tag based on implementation
2011-07-08 13:53:23 -05:00
Benjamin Peterson
639f35bbc4
on windows, rename is not atomic, so utilize exclusive access to the file
2011-07-08 13:17:42 -05:00
holger krekel
8c683acad1
finalize 2.1.0 version numbering
2011-07-08 13:23:12 +02:00
holger krekel
8713f4ba60
fix issue 35 - provide download link and improved PDF version
2011-07-08 12:42:26 +02:00
holger krekel
c40dc9f779
bump version
2011-07-07 23:21:01 +02:00
holger krekel
d1684e8052
report keyboardintterupt even if inteerrupted during sessionstartup
2011-07-07 21:24:09 +02:00
Benjamin Peterson
fb043c355e
use py.builtin.exec_
2011-07-07 09:27:40 -05:00
Benjamin Peterson
c13fa886d9
simplify rewrite-on-import
...
Use load_module on the import hook to load the rewritten module. This allows the
removal of the complicated code related to copying pyc files in and out of the
cache location. It also plays more nicely with parallel py.test processes like
the ones found in xdist.
2011-07-06 23:24:04 -05:00
holger krekel
92f8eef836
show release level info for pypy
2011-07-06 10:18:11 +02:00
holger krekel
758b5e3511
fix issue53: nose-style setup now called with the correct ordering
2011-07-05 21:23:59 +02:00
holger krekel
e91dc7c895
up pytest version to 2.1.0.dev8, depend on py-1.4.4.dev2
2011-07-05 19:14:38 +02:00
Benjamin Peterson
4e8b9fab3c
insure moving pyc files around is atomic
2011-07-05 12:02:53 -05:00
holger krekel
d105e75d87
fix pytest-xdist breakage
2011-07-05 18:01:31 +02:00
holger krekel
46950ef19a
rename and simplify the assert option:
...
cmdline usage is now: --assert=rewrite/reinterp/plain
there is no conflict detection (don't think that's neccessary)
2011-07-05 17:29:53 +02:00
holger krekel
407ca5b120
fix python2.5 compatibility
2011-07-05 15:21:08 +02:00
Benjamin Peterson
fefdca5787
simplify
2011-06-29 14:00:13 -05:00
Benjamin Peterson
c7d120ec1c
we want second resolution on mtime
2011-06-29 13:55:26 -05:00
Benjamin Peterson
1707168b62
don't try to remove pycs twice
2011-06-29 12:16:47 -05:00
Benjamin Peterson
aa7f7a1c71
rename --assertmode choices to be more explicit
2011-06-29 09:44:04 -05:00
Benjamin Peterson
48b76c7544
rewrite test modules on import
2011-06-28 21:13:12 -05:00
Benjamin Peterson
d52ff3e2b9
use a plain old list for queuing
2011-06-28 21:11:56 -05:00
Benjamin Peterson
f286a02582
rewrite with proper short-circuting on boolean operators ( fixes #57 )
2011-06-28 20:21:22 -05:00
Benjamin Peterson
c6e3606c6b
fix the rewriter on relative imports ( fixes #58 )
2011-06-28 10:39:11 -05:00
Benjamin Peterson
8772b8c928
fix name
2011-06-13 08:50:50 -05:00
Benjamin Peterson
8e81ed693a
put explanation simplification in format_explanation so everyone can benefit
2011-06-12 22:41:58 -05:00
Benjamin Peterson
d853d9a9af
treat local as a black box
2011-06-12 21:57:22 -05:00
Benjamin Peterson
57a3d4d6d8
some tweaks to allow pypy apptests to use newinterpret
2011-06-12 17:07:49 -05:00
Benjamin Peterson
43de6c270f
fix assertion introspection on python 3.2+
2011-06-03 16:51:49 -05:00
holger krekel
ce1b456762
back out pytest_configure_funcargs hook for now
2011-06-01 15:08:54 +02:00
holger krekel
e3b2792677
fix issue49 - avoid confusing errors when initialization goes wrong
2011-06-01 14:54:34 +02:00
holger krekel
67859158d4
fix issue48 - test and fix typo in MarkInfo repr
2011-06-01 08:03:06 +02:00
holger krekel
6c90059342
- properly include _pytest.assertion in distribution
...
- import assertion only at import-test module time
2011-05-31 15:21:08 +02:00
holger krekel
5690beab5a
merge Benjamin's assertion-rewrite branch: all assertion related code is now part of py.test core distribution - the builtin assertion plugin to be precise.
...
See doc/assert.txt for details on how what has been improved.
2011-05-31 14:11:53 +02:00
Benjamin Peterson
5e31624315
return to the old scheme of rewriting test modules from _importtestmodule
2011-05-28 18:47:16 -05:00
Ronny Pfannschmidt
89a98e3276
also apply normpath to junitxml file path
2011-05-28 16:21:57 +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
5f75c5851f
can use non-underscored addoption
2011-05-26 23:15:33 -05:00
Benjamin Peterson
e56838cb6c
write an explicit raise if the assertion fails
2011-05-26 21:15:40 -05:00
Benjamin Peterson
d53feaf6f0
fix help for --assertmode
2011-05-26 20:59:43 -05:00
Benjamin Peterson
914f689ee8
beef up --assertmode help
2011-05-26 20:33:12 -05:00
Benjamin Peterson
16b4f54545
remove module before/after import hooks
2011-05-26 20:00:29 -05:00
Benjamin Peterson
abb07fc732
new way to rewrite tests: do it all during fs collection
...
This should allow modules to be rewritten before some other test module loads
them.
2011-05-26 19:57:30 -05:00
Benjamin Peterson
cf6949c9a3
stuff contents of pytest_collection hook into perform_collect
2011-05-26 19:53:47 -05:00
Benjamin Peterson
2f984e0c23
remove after_initial_collect hook
2011-05-26 19:43:02 -05:00
Benjamin Peterson
0a7237b72f
refactor common config/session protocol code for main() functions
2011-05-26 19:09:42 -05:00
Benjamin Peterson
f684a9ed56
expose Session on pytest namespace
2011-05-26 18:58:31 -05:00
Benjamin Peterson
196cece338
add a hook called after the inital fs collection
2011-05-26 18:57:37 -05:00
Benjamin Peterson
241ff0b43a
add a hook called when a Module is successfully created
2011-05-26 18:56:45 -05:00
Benjamin Peterson
411e9b136b
do configure hooks here, too
2011-05-26 18:37:04 -05:00
Benjamin Peterson
96521ada68
call configure hooks in reparseconfig
2011-05-26 18:11:12 -05:00
Benjamin Peterson
657522b629
a less ugly way to detect if assert rewriting is enabled
2011-05-26 17:17:48 -05:00
Benjamin Peterson
dd199d255c
move _setupstate into session
2011-05-26 17:08:56 -05:00
Benjamin Peterson
89d6defd68
correctly initialize and shutdown sessions
2011-05-26 17:08:44 -05:00
Benjamin Peterson
bf3d9f3737
correct attribute name
2011-05-26 16:18:18 -05:00
Benjamin Peterson
32a67f9622
add some tracing in the assert plugin
2011-05-26 16:08:25 -05:00
Benjamin Peterson
d438a0bd83
introduce --assertmode option
2011-05-26 14:34:27 -05:00
Benjamin Peterson
d3645758ea
this comment was moved away
2011-05-26 13:17:39 -05:00
Benjamin Peterson
15b9e8ed7d
forgot to util module
2011-05-26 13:17:26 -05:00
Benjamin Peterson
ee64da4bad
fix grammar
2011-05-26 13:15:21 -05:00
Benjamin Peterson
4fe13e59a7
fix comment
2011-05-26 13:15:03 -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
e02d22aa4f
expand try/except/finally which py2.4 does't like
2011-05-25 15:55:57 -05:00
Benjamin Peterson
b061e71da9
account for py3 dict.values
2011-05-24 18:28:20 -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
7fc2f8786f
refactor writing the fake pyc into its own function
2011-05-24 17:48:56 -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
993efe927b
fix sentence
2011-05-24 17:28:20 -05:00
Benjamin Peterson
9c4f6791e5
give initial imports a reasonable lineno
2011-05-24 17:21:58 -05:00
Benjamin Peterson
265b7458cb
in the common case, the and operation isn't needed
2011-05-19 22:11:18 -05:00
Benjamin Peterson
dc3e39e95c
a less silly way to check comparison results
2011-05-19 21:57:27 -05:00
Benjamin Peterson
4f2166c997
use assertion rewriting on test files
...
This works by writing a fake pyc with the asserts rewritten.
2011-05-19 21:52:10 -05:00
Benjamin Peterson
e0c128beec
unconditionally override lineno and col_offset on generated ast
2011-05-19 21:49:37 -05:00
Benjamin Peterson
bf039fea74
add hooks before and after a module is imported
2011-05-19 21:45:33 -05:00
Benjamin Peterson
78be3db9bb
remove unneeded list
2011-05-19 19:15:20 -05:00
Benjamin Peterson
aae89cd021
correctly handle multiple asserts
2011-05-19 18:56:48 -05:00
Benjamin Peterson
9ac818fb5c
small refactoring
2011-05-19 18:32: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
holger krekel
95ddd5059f
bumping version and adding changelog entry for configure funcargs
2011-05-13 09:57:35 +02: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
07e870dc14
unbump version to retag
2011-05-11 11:54:30 +02:00
holger krekel
ee53b1f591
bump version
2011-05-11 11:23:46 +02:00
holger krekel
420bbfd9a9
bump version
2011-04-17 23:09:13 +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
b7ba4d4e70
shift version string to _pytest directory
2011-03-19 20:13:04 +01:00
holger krekel
3a9788fc6f
fix missing reason/name information for skipped tests
2011-03-19 17:59:07 +01:00
holger krekel
1d40abadc4
offer a semi-internal method to create a config object in subprocesses
...
(helps pytest-xdist plugin to fix issue34)
2011-03-16 18:00:52 +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
a9f1f26a39
don't import stuff at genscript import time but rather when it is used
2011-03-12 20:12:19 +01:00
holger krekel
a7131dc911
speed up skipping
2011-03-11 15:43:24 +01:00
holger krekel
55657d6c51
simplify _locationline helper
2011-03-08 13:44:53 +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
5470cadbff
fix issue25 --pdb and win32/python encodings cause a crash in certain situations.
...
The reason is not clear but avoiding a fresh copy of the terminal writer
helps, maybe because the underlying file object has some state?
2011-03-07 13:17:07 +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
9c952b3ce0
actually don't expose unused _fillfuncargs
2011-03-05 14:31:01 +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
fadd1a2313
incorporate typo/grammar fixes from Laura and respond to a number of issues she raised in comments.
...
Also fixed links and some other bits and pieces.
2011-03-03 23:40:38 +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
holger krekel
f1b5dae1fb
fix help string
2011-02-27 12:52:27 +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
d2f9b41519
some doc fixes and improvements to parametrized test examples, thanks ccxCZ for review and suggestions.
2011-02-09 14:55:21 +01: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
762ea71f67
fix error reporting issue when a "pyc" file has no relating "py"
2011-01-27 21:11:21 +01:00
Floris Bruynooghe
709d5e3f2c
Improve the "not in" assertion output
...
This cleans up the generic diff and tailors the output more to this
specific assertion (based on feedback from hpk).
2011-01-25 20:47:34 +00: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
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
feea4ea3d5
fix hasplugin() method / test failures
2010-12-06 18:32:04 +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
96a687b97c
make pytest test suite pypy ready
2010-11-27 16:40:52 +01:00
holger krekel
d894bae281
bumping version to a dev version, run tests by using python PyPI by default
2010-11-26 13:37:00 +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
1df0eaa387
tons and tons of refinements and additions to docs
2010-11-25 12:11:10 +01:00
Benjamin Peterson
8d4c9ec343
remove invalid comment
2010-11-24 21:35:36 -06:00
Benjamin Peterson
b28438171b
express filter as a listcomp
2010-11-24 19:18:42 -06:00
holger krekel
ab08cb2176
simplify pluginlist computation
2010-11-24 22:22:52 +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
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
Benjamin Peterson
ac5992f9a1
some cajoling to get pytest.py to be found when it's not on path
2010-11-23 20:27:12 -06:00
Benjamin Peterson
e2068927f9
tw is unused here
2010-11-23 20:05:40 -06:00
holger krekel
840eed28be
allow setup_class in unittest test cases
2010-11-24 00:23:39 +01:00
holger krekel
4accc4aa68
fix the py version check
2010-11-23 19:11:21 +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
2458c139e4
fix bug on windows
2010-11-22 12:42:48 +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
eaf68c1ffd
better deal with importing conftest.py with --doctest-modules and
...
re-enable default of "--doctest-modules" even if issued at root level
2010-11-18 15:31:58 +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
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
a298cf753d
some pep8 fixes
2010-11-13 23:33:50 +01:00
holger krekel
0323c5247f
perform represenation of short paths at test execution site
2010-11-13 23:33:38 +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
1bc444d5c8
some fixes to make cross linux/windows remote testing work again
2010-11-13 19:46:28 +01:00
holger krekel
868848a9a6
revert benjamin's change: script could be py.test.exe so we cannot
...
just return "python,script". When was the actual problem occuring?
2010-11-13 11:44:58 +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