holger krekel
603ff3a64f
also check for stderr, add changelog entry
...
--HG--
branch : trunk
2010-10-24 23:43:35 +02:00
holger krekel
b4210f3ae0
fix issue93 - hide output of code in early-loaded conftest files
...
--HG--
branch : trunk
2010-10-24 23:26:14 +02:00
holger krekel
1999180dfd
xpass tests don't cause non-zero exit codes
...
--HG--
branch : trunk
2010-10-22 12:00:17 +02:00
holger krekel
56afcfc9f3
make safer filenames
...
--HG--
branch : trunk
2010-10-21 16:10:37 +02:00
Ronny Pfannschmidt
039037701a
use pyfuncitem name for tmpdir in order to take generative test id into account
...
--HG--
branch : trunk
2010-10-17 00:24:59 +02:00
Ronny Pfannschmidt
5d798feaf0
fix genscript by copying the new implementation from the genscript package
...
--HG--
branch : trunk
2010-10-16 03:10:14 +02:00
Ronny Pfannschmidt
2a579217b8
alias function keywords to funcarg request keywords
...
--HG--
branch : trunk
2010-10-16 02:00:05 +02:00
holger krekel
9925ac883e
refine and document conftest loading and handling.
...
--HG--
branch : trunk
2010-10-13 18:45:07 +02:00
holger krekel
f3fb91e296
remove all deprecated functionality and tests
...
--HG--
branch : trunk
2010-10-13 18:41:53 +02:00
holger krekel
17719b99a1
select tests by call-id, add and refine documentation around it
...
--HG--
branch : trunk
2010-10-13 12:26:14 +02:00
holger krekel
3a5d28f3fe
removed unnccessary indirections in the PluginManager,
...
also fixed a bug in _core.varnames(), which probably considerably
speeds up hook calls.
--HG--
branch : trunk
2010-10-13 11:12:27 +02:00
holger krekel
04c41cb672
shift config initialization to own "config" plugin
...
--HG--
branch : trunk
2010-10-12 15:34:32 +02:00
holger krekel
7453fc107c
merge _pytest into pytester self-testing plugin
...
--HG--
branch : trunk
2010-10-12 13:10:39 +02:00
holger krekel
07c835fdf3
merge keyword into mark plugin
...
--HG--
branch : trunk
2010-10-12 13:05:29 +02:00
holger krekel
6631447161
merge config, pluginmanager, main into one file
...
--HG--
branch : trunk
2010-10-12 12:54:32 +02:00
holger krekel
6efc6dcb62
move pytest/collect.py to pytest/plugin/session.py - approaching
...
total py.test pluginizations ...
--HG--
branch : trunk
2010-10-12 12:19:53 +02:00
holger krekel
aa70d9073c
rename last test files
...
--HG--
branch : trunk
2010-10-11 08:10:55 +02:00
holger krekel
eee0e14334
internally switch to pytest.plugin.NAME instead of pytest.plugin.pytest_NAME
...
--HG--
branch : trunk
2010-10-11 01:14:40 +02:00
holger krekel
4ee3831ac9
start reorganizing docs, write more docs, shift plugin docs, to proper documentation,
...
use sphinx, remove old docs ... work in progress.
--HG--
branch : trunk
2010-10-10 23:45:45 +02:00
holger krekel
854f6a98ae
remove some more cruft
...
--HG--
branch : trunk
2010-10-10 15:52:13 +02:00
holger krekel
652d0ca636
fix tox.ini and dependencies, various fixes all around, tests pass.
...
--HG--
branch : trunk
2010-10-10 13:48:49 +02:00
holger krekel
32fce34825
move config to _config
...
--HG--
branch : trunk
2010-10-10 13:48:49 +02:00
holger krekel
51bb0f53c5
move session.py and collect.py to a unified pytest_session.py plugin.
...
--HG--
branch : trunk
2010-10-10 13:48:48 +02:00
holger krekel
d1aff902d5
remove pylib things and move things to new pytest namespace
...
--HG--
branch : trunk
2010-10-07 11:59:00 +02:00
holger krekel
f488da5cc8
merge parseopt into config module
...
--HG--
branch : trunk
2010-10-07 13:26:07 +02:00
holger krekel
98bdf022d3
merge conftesthandle into config.py
...
--HG--
branch : trunk
2010-10-07 11:51:58 +02:00
Ronny Pfannschmidt
09a9ce1da1
fix and test a unbound local in _diff_text of the assertion plugin
...
--HG--
branch : trunk
2010-10-09 07:35:28 +02:00
holger krekel
6b0db18eca
two fixes for Jython
...
--HG--
branch : trunk
2010-10-07 08:55:44 +02:00
holger krekel
253c173a88
skip attribute tests on <(2,6)
...
--HG--
branch : trunk
2010-10-06 19:57:14 +02:00
Floris Bruynooghe
ec5ea5c05e
Show final value first when explaining an attribute
...
Then show the expansion as a "where" part of the explanation.
--HG--
branch : trunk
2010-10-06 18:20:09 +01:00
holger krekel
eccc2a868c
fix issue126 : introduce py.test.set_trace() to allow dropping to
...
interactive debugging even when py.test is configured to capture output.
If you like you can override pdb.set_trace by default like this:
# content of conftest.py
def pytest_configure():
import py, pdb
pdb.set_trace = py.test.set_trace
--HG--
branch : trunk
2010-10-06 14:48:24 +02:00
antocuni
94c2fd4033
fix the annoying interaction between "pdb.set_trace()" and --pdb. The problem
...
is that pdb raises BdbQuit on exit, which is then caught by --pdb, showing an
unwanted pdb prompt. Fix it by making --pdb to ignore BdbQuit
--HG--
branch : trunk
2010-10-06 14:28:06 +02:00
holger krekel
fe54762b93
fix tests to avoid pyc-caching and skip python2.4 which doesn't support "python -m" on packages.
...
--HG--
branch : trunk
2010-10-06 09:40:14 +02:00
holger krekel
eead8f9ab4
fix issue123 - new "python -m py.test" invocation.
...
--HG--
branch : trunk
2010-10-05 17:52:32 +02:00
holger krekel
7c6e47f715
fix issue124 - make test reporting more resilient against tests changing FD 1
...
--HG--
branch : trunk
2010-10-05 17:21:50 +02:00
holger krekel
cebcdb83cf
refine printing of exceptions via the pluginmanager.
...
if there is no pytest_internalerror() hook acknowledging
receival we print the exception to sys.stderr. This helps
to see issues when there are failures in TerminalReporter
initialization.
--HG--
branch : trunk
2010-10-05 17:21:41 +02:00
holger krekel
a054b63bac
introduce py.builtin.any
...
--HG--
branch : trunk
2010-10-05 17:21:27 +02:00
holger krekel
6892dc47a3
use repr() to print extra / differing values in assertion comparison failures
...
and guard against failures in detail-representations
--HG--
branch : trunk
2010-10-04 18:49:30 +02:00
holger krekel
f6da7ea0a5
remove config.getinitialnodes() method that was only used for testing method after the refactoring.
...
--HG--
branch : trunk
2010-10-04 16:55:03 +02:00
holger krekel
29051458fc
fix issue 109 - sibling conftest.py files shall not be loaded.
...
also simplify / refine tests a bit.
--HG--
branch : trunk
2010-10-04 16:19:01 +02:00
holger krekel
4eb45dab08
small simplification and shuffling of python tests, no content change
...
--HG--
branch : trunk
2010-10-04 11:04:15 +02:00
holger krekel
939a53c436
fix a problem and make a note about pytest_nose calling setup/teardown functions
...
--HG--
branch : trunk
2010-10-03 11:17:37 +02:00
holger krekel
a6003ac332
some fixes after the merge
...
--HG--
branch : trunk
2010-10-02 20:49:24 +02:00
holger krekel
63bb9efd29
merge heads
...
--HG--
branch : trunk
2010-10-02 19:36:15 +02:00
holger krekel
77cacb99ee
to better match the naming of the corresponding AST (and in case
...
we want to add more customizations later)
rename pytest_assert_binrepr -> pytest_assertrepr_compare
rename binrepr -> reprcompare
--HG--
branch : trunk
2010-10-02 19:00:47 +02:00
holger krekel
1ff173baee
refactor assert interpretation to invoke a simple callable
...
and let the assertion plugin handle the hook invocation
and its multi-results and also pass in an (optional) test config
object to the hook. Add and refactor also a few tests.
--HG--
branch : trunk
2010-10-02 18:47:39 +02:00
holger krekel
b56d3c223d
merge Floris branch and skip interpret-tests on python2.4
...
--HG--
branch : trunk
2010-10-02 16:15:02 +02:00
holger krekel
e2c11f1ddb
fix python3 issues, add py32 environment
...
--HG--
branch : trunk
2010-09-28 17:37:20 +02:00
holger krekel
81ec29a597
fix python3 bugs
...
--HG--
branch : trunk
2010-09-28 16:38:46 +02:00
holger krekel
a60e470573
fix a collection bug where a: 🅱️ :c could not be resolved properly if
...
there are multiple 'b' nodes.
--HG--
branch : trunk
2010-09-28 15:24:36 +02:00
holger krekel
f779d3f863
rework session instantiation and exitstatus handling
...
--HG--
branch : trunk
2010-09-28 12:59:48 +02:00
holger krekel
a2fe6714f8
implement pytest_runtest_logstart(nodeid, location) hook
...
factor out a NodeInfo helper, and streamline terminal printing a bit
--HG--
branch : trunk
2010-09-26 16:23:45 +02:00
holger krekel
1c020c3d32
shift reporting info generation away from terminal reporting time, simplify code.
...
also get rid of redundant 'shortrepr' on collect/test reports
and rename reportinfo to "location" in some places
--HG--
branch : trunk
2010-09-26 16:23:44 +02:00
holger krekel
7d1585215d
clean up and simplify startup test protocols and objects
...
introduce some new experimental hooks pytest_runtest_mainloop
to better integrate distributed testing
--HG--
branch : trunk
2010-09-26 16:23:43 +02:00
holger krekel
2cf22e3124
shift all python related testing functioanlity to a dedicated
...
pytest_python
plugin which incorporates pytest's logic of python function testing (including funcargs).
--HG--
branch : trunk
2010-09-25 18:23:26 +02:00
Floris Bruynooghe
c3166ee84a
Fix bug when the right list was longer then the left
...
Thanks to Holger for finding this.
--HG--
branch : trunk
2010-09-22 18:52:07 +01:00
Floris Bruynooghe
56b955dfb5
Make pytest_assert_binrepr work on python3 too
...
--HG--
branch : trunk
2010-09-22 18:42:04 +01:00
Floris Bruynooghe
4b2cb3acbe
Merge tip from py-trunk.
...
--HG--
branch : trunk
2010-09-22 18:14:59 +01:00
Floris Bruynooghe
ca84a5e8e0
Rename pytest_assert_compare to pytest_assert_binrepr
...
Holger prefers to only have one hook and it also turns out that "in"
is actually a ast.Compare node as well too.
This also modifies the pytest_assert_binrepr hook slightly so that
it's more accomodating to other operators then just compare (i.e.
don't bail out as soon as the types of the operands differ).
--HG--
branch : trunk
2010-09-22 00:56:39 +01:00
Floris Bruynooghe
abab8f6f63
Move all tests to test_pytest_assertion
...
The py.code code is independent of any py.test specifics so we should
avoid creating dependencies on py.test in those parts.
--HG--
branch : trunk
2010-09-18 13:03:28 +01:00
Floris Bruynooghe
58169edc8e
Add set comparison
...
Also add a (too) simple mechanism too truncate too long explanations.
--HG--
branch : trunk
2010-09-16 01:06:07 +01:00
holger krekel
e2683f4538
refactor all collection related logic
...
- drop all pickling support (for now)
- perform collection completely ahead of test running (no iterativity)
- introduce new collection related hooks
- shift all keyword-selection code to pytest_keyword plugin
- simplify session object
- besides: fix issue88
--HG--
branch : trunk
2010-09-15 10:30:50 +02:00
Floris Bruynooghe
6fb56443a9
Split the tests between the core and plugin
...
The tests for _assertionnew are much better, the ones for
pytest_assert_compare() are still not great.
--HG--
branch : trunk
2010-09-08 22:21:52 +01:00
holger krekel
6f40441ef8
fixing test for python2.4 (thanks ronny)
...
--HG--
branch : trunk
2010-09-08 18:29:26 +02:00
Ronny Pfannschmidt
2b59200786
implement and naively test the native traceback style
...
--HG--
branch : trunk
2010-09-08 12:00:36 +02:00
Floris Bruynooghe
2b3ac35780
Merge py-trunk tip
...
--HG--
branch : trunk
2010-09-07 22:45:19 +01:00
holger krekel
c17bb32f70
patch from flub to allow callable objects as hook implementations
...
--HG--
branch : trunk
2010-09-07 10:03:11 +02:00
Floris Bruynooghe
cd013746cf
Initial patch as sent to py-dev
...
With a small but disasterous typo fixed though.
--HG--
branch : trunk
2010-09-06 19:35:17 +01:00
holger krekel
95bafbccd1
fix issue116 : --doctestmodules also works in the presence of __init__.py files, done by fixing the underlyingly used path.pyimport()
...
--HG--
branch : trunk
2010-09-04 09:21:35 +02:00
Ed Singleton
a2f9fbb178
Added a test and fix for nose compatible setup/teardown functions so that even less errors are ignored
...
--HG--
branch : trunk
2010-09-03 11:32:12 +01:00
Ed Singleton
f814cb5346
Added a test and fix for nose compatible setup/teardown functions that are partials, and so errors are not ignored
...
--HG--
branch : trunk
2010-09-03 11:27:47 +01:00
Ed Singleton
b690290c3f
Whitespace normalisation inside funcs in test_pytest_nose.py
...
--HG--
branch : trunk
2010-09-03 10:09:41 +01:00
Ed Singleton
c542806396
Whitespace normalisation between funcs in test_pytest_nose.py
...
--HG--
branch : trunk
2010-09-03 10:07:17 +01:00
Ed Singleton
faf0fe8887
Added a test and fix for nose compatible setup/teardown functions that contain a variable
...
--HG--
branch : trunk
2010-09-03 10:04:45 +01:00
holger krekel
d8fcc96563
committed a xfailing test for sibling conftests
...
--HG--
branch : trunk
2010-08-02 16:39:36 +02:00
holger krekel
8f2b0d0889
test and fix for apipkg (also available in apipkg default branch)
...
--HG--
branch : trunk
2010-08-01 20:43:02 +02:00
holger krekel
efeae72509
fixes issue113 - assertion represenation issue
...
--HG--
branch : trunk
2010-07-29 12:55:39 +02:00
holger krekel
74523a9d09
avoid loading conftest files which are exactly the same content as a previously loaded conftest file
...
--HG--
branch : trunk
2010-07-29 11:22:16 +02:00
holger krekel
677f7c0a6a
remove trailing whitespace everywhere
...
--HG--
branch : trunk
2010-07-26 21:15:15 +02:00
holger krekel
b14f8505d0
fix test on python2.4
...
--HG--
branch : trunk
2010-07-26 13:34:59 +02:00
holger krekel
ed8e24312c
fix terminal dimension detection to work with stdout
...
--HG--
branch : trunk
2010-07-26 13:13:10 +02:00
holger krekel
6ea944a350
don't run too-long-filename test
...
--HG--
branch : trunk
2010-07-08 15:54:51 +02:00
holger krekel
37a2898f18
reintroduce --junit - i think it is actually useful
...
--HG--
branch : trunk
2010-07-07 14:43:31 +02:00
holger krekel
320835d43f
split out pytest-xdist related reporting to the plugin
...
--HG--
branch : trunk
2010-07-07 12:41:15 +02:00
holger krekel
2664230fad
fix test for python2.7
...
--HG--
branch : trunk
2010-07-06 13:29:32 +02:00
holger krekel
b28c439494
some minor compatibility issues wrt to the just released python2.7
...
--HG--
branch : trunk
2010-07-04 22:13:12 +02:00
holger krekel
f9c5b00ffa
refine and extend custom error reporting particularly for collection-related errors
...
--HG--
branch : trunk
2010-07-04 17:06:50 +02:00
holger krekel
4a489af0ff
remove the --junitxmlprefix feature - it's kind of YAGNI i guess -
...
i introduced it after 1.3.1 but don't need it anymore and thus
it's not going to be there for 1.3.2.
--HG--
branch : trunk
2010-07-03 14:44:47 +02:00
holger krekel
5f9876d54e
apply patch from Jakub wrt fixing resultlog/xdist combo
...
--HG--
branch : trunk
2010-07-02 13:01:21 +02:00
holger krekel
f554fa03ae
make initial conftest finding ignore "--" arguments
...
--HG--
branch : trunk
2010-07-01 19:27:40 +02:00
holger krekel
b8db15a94f
refine bestrelpath to return "." for X.bestrelpath(X) and refine its docstring
...
--HG--
branch : trunk
2010-06-28 16:32:43 +02:00
holger krekel
f856db29dc
refine py.process.cmdexec handling wrt unicode on all python versions
...
--HG--
branch : trunk
2010-06-25 10:30:15 +02:00
Benjamin Peterson
4d75c703a0
correct expected message
...
--HG--
branch : trunk
2010-06-18 22:55:06 -05:00
holger krekel
149f9e1042
refine reporting with --pdb some more
...
--HG--
branch : trunk
2010-06-17 12:53:29 +02:00
holger krekel
3f1efe1b57
fix --pdb to not drop interactive on xfailed tests
...
--HG--
branch : trunk
2010-06-16 12:35:08 +02:00
Benjamin Peterson
2995d65720
fix assertion interpretation when the operator is **
...
--HG--
branch : trunk
2010-06-10 13:50:07 -05:00
Benjamin Peterson
610cde6f85
Interpret assignments while examining asserts corrects
...
fixes #105
--HG--
branch : trunk
2010-06-09 14:53:11 -05:00
holger krekel
bc6ead1a3c
introduce a new --junitprefix option to influence xml reporting.
...
also internally avoid some redundant code.
--HG--
branch : trunk
2010-06-09 16:18:47 +02:00
holger krekel
0c04577f9f
fix issue104 properly xml-escape names in junitxml files
...
--HG--
branch : trunk
2010-06-09 15:27:45 +02:00
holger krekel
523704f890
make py.test.raises as-VAR be an ExceptionInfo object
...
but only initialize it after the block is finished.
--HG--
branch : trunk
2010-06-09 14:45:41 +02:00