Commit Graph

1342 Commits

Author SHA1 Message Date
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
holger krekel b3628daa62 test and fix tracing indentation in case of exceptions 2010-11-06 20:06:32 +01:00
holger krekel 6dac77433e majorly refactor collection process
- get rid of py.test.collect.Directory alltogether.
- introduce direct node.nodeid attribute
- remove now superflous attributes on collect and test reports
2010-11-06 09:58:04 +01:00
holger krekel f181c70d8e add indent facility to tracing 2010-11-06 09:05:17 +01:00
holger krekel d108235095 implement and document new invocation mechanisms, see doc/usage.txt
also rename pytest._core to pytest.main for convenience.
2010-11-05 23:37:31 +01:00
holger krekel 6a734efe44 introduce a minimal tag-based tracer, to be extended if needed, strike pytest_trace hook. 2010-11-05 23:37:31 +01:00
holger krekel bb732a4e75 add "linelist" type for ini-files 2010-11-05 23:37:31 +01:00
holger krekel b1e4301457 document and refine py.test.fail helper and strike superflous ExceptionFailure class
refine builtin organisation and start a new doc
2010-11-05 23:37:31 +01:00
holger krekel fed8f19156 introduce norecursedirs config option, remove recfilter() 2010-11-04 23:21:26 +01:00
holger krekel 5251653fc3 remove pytest_report_iteminfo hook, i strongly guess nobody needs or uses it. 2010-11-04 23:21:23 +01:00
holger krekel 28d51e26a0 remove imperative xfail, this test passes 2010-11-03 08:09:13 +01:00
holger krekel 7d495cc250 majorly changing the unittest compatibility code, calling TestCase(name)(result) 2010-11-01 23:08:16 +01:00
holger krekel 53d1cfc3a1 allow unregistration by name 2010-11-01 09:20:58 +01:00
holger krekel 32ac7a7c6e rename addargs to addopts, make adding of opts configurable 2010-11-01 08:55:14 +01:00
holger krekel 85c24b7fa1 some test fixes and refinements 2010-11-01 08:16:10 +01:00
holger krekel cf8dd64703 slightly simplify collection node init 2010-11-01 01:01:31 +01:00
holger krekel c3ec2718a2 fix tests by using less likely existing import names 2010-11-01 00:38:44 +01:00
holger krekel 5616874823 streamline some hook docs and option handling, remove cruft bits, fix doc links 2010-10-31 23:28:31 +01:00
holger krekel 8871ca5bfa introduce "-q" option which decreases verbosity and basically leads to a unittest/nosetest-style "." output
add it in an ini file like this:

    [pytest]
    addargs=-q

and you get that by default.
2010-10-31 19:51:16 +01:00
holger krekel bb50ec89a9 remove restdoc plugin which now lives as pytest-restdoc on bitbucket,
and be easily included in a project now (like PyPy which still needs it)
2010-10-31 19:04:22 +01:00
holger krekel 23f8d8bce7 allow modules/conftest files specify dotted import paths for loading plugins 2010-10-31 19:01:46 +01:00
holger krekel 03924d205d show pytest.__version__ not pylib 2010-10-31 18:57:44 +01:00
holger krekel 35969e13ae remove feature deprecated prior even to 1.0 2010-10-31 18:46:10 +01:00
holger krekel bc574f4d94 remove superflous collect_by_name, and improve some docs
--HG--
branch : trunk
2010-10-31 18:01:33 +01:00
holger krekel b6ec5a575d get option settings from ini-file. make getting configuration options from conftest.py only an internal feature.
--HG--
branch : trunk
2010-10-31 17:41:58 +01:00
holger krekel 1280041f0c add and document new parser.addini(name, description) method to describe
ini-values. Also document the parser object with its public methods.

--HG--
branch : trunk
2010-10-30 19:23:50 +02:00
holger krekel 2d8bcbdf55 document "setup.py test" to use genscript'ed version.
--HG--
branch : trunk
2010-10-28 09:29:56 +02:00
holger krekel c9e629c870 remove old ways to set option defaults, relying on global setup.cfg or tox.ini files now.
revamp py.test --help-config

--HG--
branch : trunk
2010-10-27 22:29:01 +02:00
holger krekel b86b1628bb introduce reading of setup.cfg / ini-style configuration files
rename internal config.Error to pytest.UsageError

--HG--
branch : trunk
2010-10-27 19:35:27 +02:00
holger krekel 90c1084a88 add --lsof self-testing option
--HG--
branch : trunk
2010-10-26 09:11:53 +02:00
holger krekel 5fc87acf9b re-introduce compatibility attributes on collection nodes to keep compatible with code like::
def pytest_collect_file(path, parent):
        ... parent.Module(...)

--HG--
branch : trunk
2010-10-25 23:09:21 +02:00
holger krekel 4480401119 allow unittest test functions to work with the "pytestmark" mechanism
by refactoring mark/keyword handling and initialization

--HG--
branch : trunk
2010-10-25 23:08:56 +02:00
holger krekel a6f10a6d80 unify collection for finding items and for finding initial nodes.
--HG--
branch : trunk
2010-10-25 23:08:41 +02:00
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
holger krekel 6951da7da0 merge Ronny's changes, add some documentation and changelog entries
--HG--
branch : trunk
2010-06-09 14:26:08 +02:00
Ronny Pfannschmidt d1c8209875 support using py.test.raises in context manager style
--HG--
branch : trunk
2010-06-09 10:50:00 +02:00
holger krekel 64388832d9 introduce a new request.applymarker() function and refactor
internally to allow for dynamically adding keywords to test
items.

--HG--
branch : trunk
2010-06-08 02:34:51 +02:00
holger krekel 804dcd3521 some adjustments to make py.test --basetemp=XYZ work where
XYZ is a subdir the checkout which contains a conftest.py

--HG--
branch : trunk
2010-06-07 21:02:26 +02:00
holger krekel c1d0fc9aaf add ignore_errors to local.remove()
--HG--
branch : trunk
2010-06-07 20:48:36 +02:00
holger krekel 10b8de060a fix py.code.compile to generate unique filenames
--HG--
branch : trunk
2010-06-06 19:08:22 +02:00
holger krekel 10baa7f8af fix python3 failure by making a relative import work
--HG--
branch : trunk
2010-06-05 16:10:17 +02:00
holger krekel c56f4f9444 don't depend on (and don't actually use anymore) testing/__init__.py
--HG--
branch : trunk
2010-06-04 00:39:58 +02:00
Ronny Pfannschmidt f8404be1b2 add a rootdir param to py.path.local.mkdtemp
--HG--
branch : trunk
2010-06-03 11:14:32 +02:00
Ronny Pfannschmidt a07e494554 add kwarg support to py.errpr.checked_call
--HG--
branch : trunk
2010-06-03 10:21:48 +02:00
holger krekel 75d80ca183 fix pyimport() bug on directories
--HG--
branch : trunk
2010-05-31 17:06:46 +02:00
holger krekel b66b5e2715 fix issue 57 - make --looponfail work with xpassing tests
--HG--
branch : trunk
2010-05-26 18:55:50 +02:00
holger krekel c953c7d313 fix issue102 by introducing a --maxfailures=NUM option
also print an informative line about "stopped/interrupted" test runs
near the end.

--HG--
branch : trunk
2010-05-25 16:52:09 +02:00
holger krekel fa074da5a9 when --runxfail is supplied also show tracebacks when running a test that
calls py.test.xfail

--HG--
branch : trunk
2010-05-22 17:08:49 +02:00
holger krekel 29a5b7452e * improve and test --tb=short reporting
* show --tb=short tracebacks for importing test modules

--HG--
branch : trunk
2010-05-22 16:18:24 +02:00
holger krekel 93712a3ce6 terser reporting header
--HG--
branch : trunk
2010-05-22 13:59:01 +02:00
holger krekel 4f7ef0b63f fix issue89 - allow py.test.mark decorators to be used with classes
(if you are using >=python2.6)
also allow to have multiple markers applied at class level
and test and fix a bug with chained skip/xfail decorators:
if any of the conditions is true a test will be skipped/xfailed
with a explanation which condition evaluated to true.

--HG--
branch : trunk
2010-05-21 18:11:47 +02:00
holger krekel 578cba20d4 fix issue94 make reporting more robust against bogus source code
(and internally be more careful when presenting unexpected byte sequences)
also make py.code.Source accept a list of lines directly.

--HG--
branch : trunk
2010-05-21 16:42:46 +02:00
holger krekel 93f91c9607 unify handling of reportcharacters across resultlog/junitxml plugins
--HG--
branch : trunk
2010-05-20 14:35:13 +02:00
holger krekel 925f75088d fix issue91 introduce new py.test.xfail(reason) helper
to imperatively mark a test as expected to fail. Can
be used from within setup and test functions. This is
useful especially for parametrized tests when certain
configurations are expected-to-fail.  In this case the
declarative approach with the @py.test.mark.xfail cannot
be used as it would mark all configurations as xfail.

--HG--
branch : trunk
2010-05-20 13:29:51 +02:00
holger krekel eac0345689 fix wrong test invocation
--HG--
branch : trunk
2010-05-19 17:05:13 +02:00
holger krekel 20424a9c76 fix and test "-rP" option to show xpass-test ids
--HG--
branch : trunk
2010-05-19 16:52:03 +02:00
holger krekel 2229d2d947 revert 1735 - fix issue95 differently: just shift the offending zlib
import (and others) to happen when they are actually needed

--HG--
branch : trunk
2010-05-19 16:42:22 +02:00
holger krekel c3bd29b490 fix issue95 - treat a failing pytest_genscript import
as non-critical, give a hint.

--HG--
branch : trunk
2010-05-19 16:22:23 +02:00
holger krekel cf255cd643 some special handling of stdin capturing, unification, un-xfail the win32 test
--HG--
branch : trunk
2010-05-18 12:12:34 -07:00
holger krekel 10296faff1 for now don't test close(0) on windows - it hangs there
--HG--
branch : trunk
2010-05-18 11:43:22 -07:00
holger krekel 9f5e6f9761 simplify and unify FDCapture API and usage:
* FDCapture now takes care through the 'patchsys' option to
  also set sys.stdin/out/err - setfiles/unsetfiles methods removed -
  i doubt anybody uses this outside of py.test's own old usage.
* stdin also goes through FDCapture now.

--HG--
branch : trunk
2010-05-18 20:03:44 +02:00
holger krekel da097c9d67 deal gracefully with invalid file descriptors - don't capture the particular stream
--HG--
branch : trunk
2010-05-18 16:52:56 +02:00
holger krekel 4f5d7948f7 - try to fix the nightly failures by refining internal capturing mechanism
and adding tests, including a "lsof" test for making sure the number of
  open file descriptors does not increase.
- also move a py.io related logging test to testing/io

--HG--
branch : trunk
2010-05-18 16:01:58 +02:00
holger krekel 1a97c59439 fix test to account for earlier capfd skipping (on jython)
--HG--
branch : trunk
2010-05-18 09:54:04 +02:00
holger krekel e71685736e fix issue96 - make capturing more resilient against KeyboardInterrupt
--HG--
branch : trunk
2010-05-17 19:00:39 +02:00
holger krekel f97e082543 fix test to work on jython and cpy
--HG--
branch : trunk
2010-05-14 15:25:24 +02:00
holger krekel 91880ffc19 adding three x-failing tests for issue88, issue93 and related issues
--HG--
branch : trunk
2010-05-14 12:02:43 +02:00
holger krekel 169d8d1e54 fix test to account for jython python file ending
--HG--
branch : trunk
2010-05-12 14:12:07 +02:00
holger krekel 379390a8aa remove code.new() function and store lines directly into linecache.cache instead.
This avoids the need for custom code objects, improving compatibility for jython
and pypy-c.

--HG--
branch : trunk
2010-05-11 22:54:04 +02:00
holger krekel 8ba2a98e11 allow to run py.test.cmdline.main() multiple times.
--HG--
branch : trunk
2010-05-11 19:56:22 +02:00
holger krekel ee036223ce deprecate --report option in favour of a new shorter and easier to remember -r option: this takes a string argument consisting of any combination of 'xsfX'
Those letters basically correspond to the letters you see during terminal reporting.

--HG--
branch : trunk
2010-05-05 19:50:59 +02:00
holger krekel c933ada7fb new --runxfail option to ignore xfail markers on functions
--HG--
branch : trunk
2010-05-04 13:02:27 +02:00
holger krekel 28150c7486 add unit-tests for xfail and refine xfail handling and reporting
--HG--
branch : trunk
2010-05-04 12:37:56 +02:00
holger krekel dd7fd97810 add a terminalreporter.testid method
--HG--
branch : trunk
2010-05-04 12:37:52 +02:00
holger krekel 1a8b2838fa add new parameters:
xfail(run=False) will not run expected-to-fail tests
xfail(reason=True) will report the specified reason

--HG--
branch : trunk
2010-05-02 22:13:16 +02:00
holger krekel 82d4aae571 some internal fixes regarding the new required hook-finding prefix
--HG--
branch : trunk
2010-05-02 17:10:38 +02:00
holger krekel fd473d4002 refine and test new hook registration, now it is called "pytest_addhooks"
similar to pytest_addoption and raises on bogus input.

--HG--
branch : trunk
2010-05-02 16:36:53 +02:00
holger krekel 45e10f4c48 rename pytest_ignore_collect_path to pytest_ignore_collect before release
--HG--
branch : trunk
2010-05-02 15:24:02 +02:00
Ronny Pfannschmidt b3ce06bbf9 add close method to DontReadFromInput so multiprocessing can close it
--HG--
branch : trunk
2010-04-29 19:46:43 +02:00
holger krekel 962d0fe2be introduce new pytest_pycollect_makemodule(path, parent) hook for
allowing customization of the Module collection object for a matching test module.

--HG--
branch : trunk
2010-04-29 16:53:29 +02:00
holger krekel 811408959f introduce a new pytest_ignore_collect_path(path, config) hook -
returning a true value will prevent considering the path for collection
The hook is called for both files and directory paths.

--HG--
branch : trunk
2010-04-29 16:20:55 +02:00
holger krekel 5ece3858e4 introduce new py.io.saferepr for printing the 'repr' of an object safely
and without consuming too much space

--HG--
branch : trunk
2010-04-29 14:17:07 +02:00
holger krekel 1c1623885f fix a py3k related skip - py.io.TextIO on py3k should probably
not allow to write bytes to it.

--HG--
branch : trunk
2010-04-29 10:50:20 +02:00
holger krekel 5dc66bb4ca make py.io.ansi_print and py.io.get_terminal_width() directly available.
--HG--
branch : trunk
2010-04-29 10:49:50 +02:00
holger krekel 030548bc73 expose py.code._reinterpret functions so that pypy and internal
uses don't need to go through internal implementation imports

--HG--
branch : trunk
2010-04-29 01:20:56 +02:00
Benjamin Peterson d93016d85f remove the unused return value of fnmatch_lines
--HG--
branch : trunk
2010-04-28 17:12:38 -05:00
holger krekel 22a50a5b88 * various jython related fixes.
* more care for print-errors including unicode-encoding related errors.

--HG--
branch : trunk
2010-04-28 15:24:38 +02:00
holger krekel 78d33a2f28 * rather expose internal exceptions under py.test.ACTION.Exception
with ACTION being skip, fail, exit, raises.
* move and refine test_outcome.py tests into runner tests

--HG--
branch : trunk
2010-04-28 08:42:56 +02:00
holger krekel d5e463605e * properly expose and document runtest-protocol related Exceptions
and move all definitions to the runner plugin for now.

* also move EXIT codes to session.py, obsoleting outcome.py alltogether.

--HG--
branch : trunk
2010-04-27 21:13:09 +02:00
holger krekel ed7a2d2da3 refine/fix isimportable-logic and ensure that 'tmpdir' has a python-importable name
--HG--
branch : trunk
2010-04-27 16:10:25 +02:00
holger krekel 8131f5bdc0 (fixes issue83) don't try to import conftest from an invalid package path, refine path.pyimport() logic
--HG--
branch : trunk
2010-04-27 15:49:13 +02:00
holger krekel c8d78177b9 (fixes issue85) correctly write non-ascii test output to junitxml files, refine some internal methods for it
--HG--
branch : trunk
2010-04-27 15:15:43 +02:00
holger krekel f6a04b92d2 fix unicode issues (port of pypy/py repo changeset r72526 by Armin)
--HG--
branch : trunk
2010-04-27 12:23:13 +02:00
Benjamin Peterson 7629b8fda7 make test source syntax valid
--HG--
branch : trunk
2010-04-23 20:49:00 -05:00
Benjamin Peterson d1b45ef3d4 add a helper to get a function's code
--HG--
branch : trunk
2010-04-23 20:39:40 -05:00
Benjamin Peterson f16d54f9a8 merge main
--HG--
branch : trunk
2010-04-23 20:28:32 -05:00
Benjamin Peterson d909aead4e provide encoding to dupfile() for py3
--HG--
branch : trunk
2010-04-23 20:27:34 -05:00
holger krekel 0b24a70279 this should test and fix the same issue that was committed in
the pypy svn-repo as r72534

--HG--
branch : trunk
2010-04-23 19:28:41 +02:00
holger krekel b3a05b545e another couple of checks on jython, still some problems
--HG--
branch : trunk
2010-04-23 19:05:22 +02:00
holger krekel 221ac3e466 a couple of more mostly jython-related fixes
--HG--
branch : trunk
2010-04-23 13:29:28 +02:00
hpk@tannit.openend.se 4337702a6a fixes for testrun on jython
--HG--
branch : trunk
2010-04-23 12:05:29 +02:00
holger krekel 85d35f7418 introduce an experimental approach for allowing dynamic addition of hooks from plugin. Plugins may register new hooks by implementing the new
pytest_registerhooks(pluginmanager)

and call

    pluginmanager.registerhooks(module)

with the referenced 'module' object containing the hooks.

The new pytest_registerhooks is called after pytest_addoption
and before pytest_configure.

--HG--
branch : trunk
2010-04-22 11:57:57 +02:00
holger krekel cbb4c0dadc use taskkill cmdline for jython/win32 but skip test on jython because it does not return a subprocess PID
--HG--
branch : trunk
2010-04-21 06:23:19 -07:00
holger krekel c10f0c2c36 merge in fixes
--HG--
branch : trunk
2010-04-21 14:49:38 +02:00
holger krekel 061f4c1515 robustify check
--HG--
branch : trunk
2010-04-21 14:46:41 +02:00
holger krekel fe34a8a15a a couple of more fixes/refinements for getting py.test to run better on jython/win32
--HG--
branch : trunk
2010-04-21 03:50:03 -07:00
holger krekel 5715bbd6f5 refining the win32 checks some further
--HG--
branch : trunk
2010-04-20 20:08:52 +02:00
holger krekel 536252cb2e refine win32 checks to also work on top of jython/win32
--HG--
branch : trunk
2010-04-20 10:45:41 -07:00
holger krekel c7326f1949 fix a pdb problem when dropping to a "raises" related failure
--HG--
branch : trunk
2010-02-08 14:17:01 +01:00
holger krekel d163d92b33 actually look into all non-dot subdirs for conftest.py files - recursive walk would be too heavy for large source trees but first-level subdirs are fine IMO. Note that prior to py.test 1.0 doing this "look-ahead" was not easily doable because it was hard to avoid global state in conftest.py, this is not true anymore - so i feel ok telling people to cleanup their conftest files if they get problems (you can imagine people doing all kinds of things at global conftest.py module scope, can't you?)
--HG--
branch : trunk
2010-02-06 22:37:04 +01:00
holger krekel 105ed6dcaa fix this test
--HG--
branch : trunk
2010-02-05 22:57:46 +01:00
holger krekel a3d15b2c60 refined usage and options for "py.cleanup":
py.cleanup     # remove "*.pyc" and "*$py.class" (jython) files
    py.cleanup -e .swp -e .cache # also remove files with these extensions
    py.cleanup -s  # remove "build" and "dist" directory next to setup.py files
    py.cleanup -d  # also remove empty directories
    py.cleanup -a  # synonym for "-s -d -e 'pip-log.txt'"
    py.cleanup -n  # dry run, only show what would be removed

--HG--
branch : trunk
2010-02-05 22:50:41 +01:00
holger krekel 3234e6e978 add a --funcargs option showing available funcargs
--HG--
branch : trunk
2010-02-04 23:45:07 +01:00
holger krekel 02c129df7a fix a test
--HG--
branch : trunk
2010-02-04 16:13:30 +01:00
holger krekel f95877a09b show a short and nice traceback for funcarg lookup errors
--HG--
branch : trunk
2010-02-04 16:01:02 +01:00
holger krekel 7bd60b5abb check and load test*/conftest.py early from anchors -
this makes it a bit more convenient to have command line options
available from a root directory of a project that does not
directly contain a conftest.py

--HG--
branch : trunk
2010-02-04 12:26:53 +01:00
holger krekel 9d64d7e27a refine setup ordering some more - test and avoid a problem with funcarg setups where the
surrounding setup_module would fail, but the funcarg setup still be called (which might
assume that setup_module has been called so would raise a confusing error)

--HG--
branch : trunk
2010-01-28 15:36:27 +01:00
holger krekel a2af204687 again addresses issue78 : we now call teardown also if setup raised a Skipped exception.
I also made sure, setup_module/class will only be called once - before they'd be call again
and again if they raise an error or a skip - for each test in their scope.

--HG--
branch : trunk
2010-01-28 14:20:58 +01:00
holger krekel 4d5ea7be43 install pygments for tests
--HG--
branch : trunk
2010-01-27 13:02:02 +01:00
holger krekel 98608611af closes #67 new super-short traceback-printing option: "--tb=line" will print a single line for each failing (python) test indicating its filename, lineno and the failure value
--HG--
branch : trunk
2010-01-27 12:52:19 +01:00
holger krekel b18ab6e03b fix issue78 - now python-level teardown functions are now called even if the setup failed.
Important detail: if the setup raises a Skipped exception, teardown will not be called.  This helps
to avoid breaking setup_module/class that performs a skip - it would otherwise internally
be considered as a "successful" setup in order to have teardown called later.  I guess
it also makes sense to treat Skip specially because it is unlikely a teardown should be
called if a Skip was raised on setup.

In any case, failing setups and teardowns will be reported separately.

--HG--
branch : trunk
2010-01-27 12:09:30 +01:00
holger krekel f7c562e492 better default for bogus terminal getdimensions() call, fixes issue63
--HG--
branch : trunk
2010-01-19 10:34:41 +01:00
holger krekel d3c0ff3a1f make sure we get an absolute path when writing the genscript file
--HG--
branch : trunk
2010-01-18 16:48:20 +01:00
holger krekel 55fcc5a219 always directly use basename for tracebacks, independently from code.path
fixes issue77 although i guess it was already fixed before.

--HG--
branch : trunk
2010-01-18 12:12:18 +01:00
holger krekel 0149771997 refine excludepath handling to treat entries with no path as matching
--HG--
branch : trunk
2010-01-18 03:04:20 +01:00
holger krekel 89068d9471 fix python2.4 issue
--HG--
branch : trunk
2010-01-18 02:01:16 +01:00
holger krekel d483f18374 move rsync reporting out
--HG--
branch : trunk
2010-01-18 00:41:22 +01:00
holger krekel 95de17b652 refine tests and refine code to deal with new xdist semantics.
--HG--
branch : trunk
2010-01-17 23:23:02 +01:00
holger krekel 09671eb6fc rename logxml plugin to junitxml
--HG--
branch : trunk
2010-01-16 23:33:26 +01:00
holger krekel 6f0db1d193 kill unused code
--HG--
branch : trunk
2010-01-16 19:41:05 +01:00
holger krekel 76e49b57bf fix test_importall to not stop on skipped plugins and fix the uncovered failure of genscript: standalone.py template is now safely importable
--HG--
branch : trunk
2010-01-15 18:45:06 +01:00
holger krekel 4a568f43fe get rid of the funccollector node, which nice-ifies names of funcarg-generated tests nodes, also test and fix one anomaly wrt to funcarg setups and instance uniqueness
--HG--
branch : trunk
2010-01-15 17:50:02 +01:00
holger krekel ee2f292efa remove superflous building of a dict, preserve order for nodes that have identical file:lineno
--HG--
branch : trunk
2010-01-15 17:38:09 +01:00
holger krekel 030986dcc4 reduce usage of the global py.test.config which maybe should die or become less global at some point (along with py.test.ensuretemp)
--HG--
branch : trunk
2010-01-13 18:04:58 +01:00
holger krekel 9da1ba40ed move down py/impl/XYZ to py/_XYZ
--HG--
branch : trunk
2010-01-13 17:15:54 +01:00
holger krekel 5c27076d32 flatten test directory hierarchy and merge smaller into larger files
--HG--
branch : trunk
2010-01-13 16:17:50 +01:00
holger krekel 40f41496d8 remove dist-testing and looponfail code from core. there remain some (pytest_runner particularly) tests that test both plain and dist modes which cannot be easily dis-entangled. food for thought.
--HG--
branch : trunk
2010-01-13 16:00:33 +01:00
holger krekel d4f5073076 remove figleaf which now lives "outside"
--HG--
branch : trunk
2010-01-13 00:47:20 +01:00
holger krekel 59f3adb46b fix reqs2 to point to released execnet
--HG--
branch : trunk
2010-01-12 21:57:26 +01:00
holger krekel d53572a710 introduce a new pytest_report_header(hook) hook to add additional test-run relevant information to the header of a test report.
--HG--
branch : trunk
2010-01-12 21:43:25 +01:00
holger krekel a9fe84d9b9 adding a second requirements file which uses execnet-1.0.2
--HG--
branch : trunk
2010-01-12 16:15:07 +01:00
holger krekel 1b0d6296dd test and fix looponfailing wrt to a bug introduced with the cmdline/session startup cleanup.
--HG--
branch : trunk
2010-01-12 16:08:48 +01:00
holger krekel 8d9e0712be refine classname normalization for junit-xml
--HG--
branch : trunk
2010-01-12 01:35:50 +01:00
holger krekel 3296939eda fix sessionstart/sessionfinish handling at the slave side, set "session.nodeid" to id of the slave and make sure "final" teardown failures are reported nicely. fixes issue66.
--HG--
branch : trunk
2010-01-11 17:09:07 +01:00
holger krekel ba1451330e refine rsyncing and internal dir/transferal handling: don't transfer roots in a popen- no-chdir situation and only use one py._pydir everywhere
--HG--
branch : trunk
2010-01-11 14:30:50 +01:00
holger krekel 352e305431 fix and test bug: dist-testing now works again without execnet/pylib installed remotely. fixes issue65.
--HG--
branch : trunk
2010-01-10 23:52:23 +01:00
holger krekel 99301a0dae (experimental) allow cmdline arguments to deep-point to a test, also remove virtually redundant session.getinitialitems() calls
--HG--
branch : trunk
2010-01-10 21:29:36 +01:00
holger krekel 3029aa6558 fix some "import py" test issues, and prevent "genscript" script from having dist-options
--HG--
branch : trunk
2010-01-10 20:45:37 +01:00
holger krekel 3239bd250b avoid dependency on directory ordering
--HG--
branch : trunk
2010-01-03 18:19:52 +01:00
holger krekel 9fcd108091 relax a test to pass on jython and fix install docs to include genscript standalone usage.
--HG--
branch : trunk
2010-01-03 14:19:31 +01:00
holger krekel 27aa14c20f fix python3 issues, add missing plugin docs
--HG--
branch : trunk
2010-01-03 13:27:06 +01:00
holger krekel 1b34492108 vastly simplify and cleanup collection initialization by internally
introducing a RootCollector. Note that the internal node
methods _fromtrail and _totrail are shifted to the still internal
config._rootcol.fromtrail/totrail

--HG--
branch : trunk
2010-01-03 01:02:44 +01:00
holger krekel eebeb1b257 enable doctest plugin by default, add a --doctest-glob option and some documentation, regen plugin docs.
--HG--
branch : trunk
2010-01-02 23:30:46 +01:00
holger krekel 56a936993c enhance figleaf setup, enabled by default now (requires --figleaf). Generalize internal ability to show "hints" at the end of "-h".
--HG--
branch : trunk
2010-01-02 22:48:53 +01:00
holger krekel 1b6391d814 higher timeout to accomodate slower execution environments
--HG--
branch : trunk
2010-01-02 18:32:11 +01:00
holger krekel f3e62e38aa streamlined plugin loading: order is now setuptools, ENV, commandline
and setuptools entry point names are turned to canonical namees ("pytest_*")

--HG--
branch : trunk
2010-01-02 17:17:13 +01:00
holger krekel a20e60aeae slightly refine invocation of py.test: use the py lib that we got invoked with,
does away with the need to not-chdir some tests

--HG--
branch : trunk
2010-01-02 11:57:42 +01:00
holger krekel e0dd171e45 fix standalone script generation on windows, make tests not do a chdir() so that distributed testing discovers the transferred lib
--HG--
branch : trunk
2010-01-01 21:54:27 +01:00
holger krekel 47df1e16b6 fix some failures introduced by the last commit, document new "pytestconfig" funcarg
--HG--
branch : trunk
2010-01-01 21:03:33 +01:00
holger krekel 2752168a58 introduce --confcutdir option to early-inhibit lookup of conftest files above a certain directory.
--HG--
branch : trunk
2009-12-31 15:10:32 +01:00
holger krekel eb4249322e fix xml generation for skipped collections of tests
--HG--
branch : trunk
2009-12-31 11:50:01 +01:00
holger krekel 587951966f adding a logxml plugin and a --xml=path option generating a junit-xml style result log. The xml result log can be parsed nicely by hudson.
Initial code was based on Ross Lawley's pytest_xmlresult plugin.

--HG--
branch : trunk
2009-12-31 11:25:07 +01:00
holger krekel fa0c7b18bf move standalone script to become a plugin offering "--genscript",
adjust paths accordingly and add CHANGELOG entry.

--HG--
branch : trunk
2009-12-30 19:10:49 +01:00
holger krekel a42d9eb9f6 fix some standalone-script running issues:
* standalone can run standalone tests
* exception handling is more careful with assuming valid filenames
* bits here and there

--HG--
branch : trunk
2009-12-30 18:11:00 +01:00
holger krekel f5ea19858c deprecate direct definition of Directory, Module, ... in conftest.py's,
add some pytest collect related tests + some refinements.

--HG--
branch : trunk
2009-12-30 16:18:59 +01:00
holger krekel d3b20e8d24 refine deprecations, move some over to test_deprecated_api
--HG--
branch : trunk
2009-12-30 14:07:20 +01:00
holger krekel 30bbf3b042 fix aimed at passing jstests functional tests: allow to have _fillfuncargs() called even for non-pycollect-object test-items.
--HG--
branch : trunk
2009-12-30 14:05:41 +01:00
holger krekel 89f178bf4d streamline svn test setup a bit, clear caches on setup-restore, hopefully will erase random failures with test_export.
--HG--
branch : trunk
2009-12-30 13:05:08 +01:00
holger krekel 4656bc4c97 deprecate use of 'disabled'
--HG--
branch : trunk
2009-12-30 12:13:38 +01:00
holger krekel f02b84d528 update ISSUES some more, introduce duration to RunResult and a failing dist-testing termination test.
--HG--
branch : trunk
2009-12-30 11:37:46 +01:00
holger krekel a15afb5e48 skip tests using 'capfd' funcarg but not having os.dup. cleanup issues and regen plugin docs.
--HG--
branch : trunk
2009-12-30 11:16:20 +01:00
holger krekel ae63605ac0 generalize hook calling from collection nodes but stop short
of allowing general hooks in python test modules. It'd be
easily possible (a 1-line change) but considering it i refrained
from it because the collector API is a bit too low level.

pytest_generate_tests and funcarg factories have a limited
directly useful interface and are thus less confusing - those
are taking advantage of hook discovery in python test modules.

--HG--
branch : trunk
2009-12-30 10:42:01 +01:00
holger krekel 631dfe9f13 only consider matching conftest plugins for discovering hooks related to collection nodes.
--HG--
branch : trunk
2009-12-30 02:36:58 +01:00
holger krekel 9d01975c78 fix capturing to be more careful during teardown when a setup never happened (due to e.g. an error in user-provided runtest_setup code)
--HG--
branch : trunk
2009-12-30 00:11:27 +01:00
holger krekel 77b640d1b7 streamline some tests and overall reduce py.test.ensuretemp usage, note down issue about deprecation .
--HG--
branch : trunk
2009-12-29 22:26:03 +01:00
holger krekel 9be7d78fb1 some debug info aimed at helping to find out about a randomly failing test_export
test setup issue

--HG--
branch : trunk
2009-12-29 21:18:17 +01:00
holger krekel c348cec481 make looponfailing a bit more robust against relative imports and changed directories - needs more work, probably.
--HG--
branch : trunk
2009-12-29 18:41:24 +01:00
holger krekel 79af98fc29 some testing hygene: move _reparse testing functionality to actual test support code, un-xfail a now passing test, reduce direct py.test.config usage aiming for deprecation.
--HG--
branch : trunk
2009-12-29 18:02:54 +01:00
holger krekel db21cac694 cleanup py.test.* namespace, docstrings for improved pydoc and interactive usage.
use new apipkg __onfirstaccess__ feature to initialize the py.test namespace with the default plugins.  This, besides other good implications, means that you can now type:  pydoc py.test   or help(py.test)

--HG--
branch : trunk
2009-12-29 16:29:48 +01:00
holger krekel 71e332c9c4 robustiy some randomly failing tests
--HG--
branch : trunk
2009-12-29 12:36:45 +01:00
holger krekel 425e4849f3 remove/reduce internal global state: py._com.registry is now fully contained and always instantiated from the py.test PluginManager class.
--HG--
branch : trunk
2009-12-29 12:36:17 +01:00
holger krekel 8737254a74 simplify pluginmanager, move plugin validation code to plugin, remove unused code
--HG--
branch : trunk
2009-12-29 10:59:01 +01:00
holger krekel 0361b73d75 remove defaultconfest.py and make PluginManager directly do early initialization of default plugins.
--HG--
branch : trunk
2009-12-29 10:26:51 +01:00
holger krekel 27bcd2dbda always import defaultconftest by python import path. strike some redundant code.
--HG--
branch : trunk
2009-12-28 17:49:46 +01:00
holger krekel abb05d9384 fixing windows32 svn-testing issues
--HG--
branch : trunk
2009-12-25 01:47:43 -08:00
holger krekel 516cee2a94 windows fixes and print funcargs for keyboardinterrupt traces
--HG--
branch : trunk
2009-12-25 09:53:36 +01:00
holger krekel 88e61467f1 fixing and cleaning up some tests
--HG--
branch : trunk
2009-12-25 00:24:58 +01:00
holger krekel 6d46efa87a introduce --ignore option to ignore paths during collection
--HG--
branch : trunk
2009-12-24 22:23:45 +01:00
holger krekel 7864f6a4fd rather use newest execnet always
--HG--
branch : trunk
2009-12-24 20:35:18 +01:00
holger krekel 51a684f488 adding pip requirements file
--HG--
branch : trunk
2009-12-24 20:22:19 +01:00
holger krekel f254b6f7c1 fixes to various tests, related to execnet automatic ID generation and other bits.
also lowering the version as "1.1.1post1" for now.  1.1.2 is still a bit off.

--HG--
branch : trunk
2009-12-24 19:43:14 +01:00
Benjamin Peterson ec96ab5286 2.7's TextIO requires unicode
--HG--
branch : trunk
2009-12-06 11:47:41 -06:00
holger krekel 56c1391a16 fix keyword calling
--HG--
branch : trunk
2009-11-27 20:32:21 +01:00
holger krekel 9d5b313aad adjustments and fixes to test run, distribution files. thanks thm.
--HG--
branch : trunk
2009-11-24 15:16:58 +01:00
holger krekel 9652be0ac1 don't consider setuptools plugins if it is not installed.
--HG--
branch : trunk
2009-11-24 10:49:04 +01:00
holger krekel ed03eef81b introduce plugin discovery through setuptools "pytest11" entrypoints
and refine execnet dependency handling.  Prepare 1.1 release

--HG--
branch : trunk
2009-11-23 17:20:36 +01:00
holger krekel bcede77e45 fix a flaky test
--HG--
branch : trunk
2009-11-20 10:04:40 +01:00
holger krekel 452ce50d7d fix compatibility issue with svnwc.update and put CHANGELOG to rootlevel
--HG--
branch : trunk
2009-11-20 00:12:06 +01:00
holger krekel 6d9e3ac686 adapt to new execnet.Group code (since execnet-1.0.0b4), strike superflous code
--HG--
branch : trunk
2009-11-19 23:13:29 +01:00
holger krekel 3adf6687c9 reintroduce py.test.cmdline.main() (alias for py.cmdline.pytest())
resolves issue #61

--HG--
branch : trunk
2009-11-19 23:13:28 +01:00
holger krekel 1a86d09da4 a few internal test related fixes as to run on a osx/no-execnet situation
--HG--
branch : trunk
2009-11-12 21:15:59 +01:00
holger krekel f4ec2d1ecd improve deprecation, start changelog
--HG--
branch : trunk
2009-11-12 13:10:30 +01:00
holger krekel a4a652af85 fix a bug with svnwc.listdir() not accepting a checker(versioned=...)
--HG--
branch : trunk
2009-11-12 13:09:27 +01:00
holger krekel a5a94c4e8f largely improve and reshuffle docs, heading strongly towards a 1.1.0
--HG--
branch : trunk
2009-11-05 03:18:55 +01:00
holger krekel b04a04cabd make py lib a self-contained directory again
- move and merge _py/ bits back to py/
- fixes all around

--HG--
branch : trunk
2009-11-04 21:34:07 +01:00
holger krekel 6a82cdb37f fix jython issue, flexibilize sysexec params
--HG--
branch : trunk
2009-10-29 23:46:14 +01:00
holger krekel 30710a9cd6 fix windows32 issues, introduce a simplistic path.samefile for it, fix tests
--HG--
branch : trunk
2009-10-29 20:10:05 +01:00
holger krekel 92d482069c moving py/bin to rootlevel bin/ and fixing tests
--HG--
branch : trunk
2009-10-29 16:53:02 +01:00
holger krekel cc15685015 remove pyrest and _py/rest before first 1.1. release
--HG--
branch : trunk
2009-10-29 12:25:47 +01:00
holger krekel 58e1693af0 fix a test-import issue occuring when there is a second 'testing' directory in PYTHONPATH or so.
--HG--
branch : trunk
2009-10-28 21:33:26 +01:00
holger krekel 86fc12dd15 resolves issue #59
resolves issue #48

Have the path.pyimport() helper raise an EnvironmentError if an
import of a given file returns a module that does not appear to
be coming from the actual path.  E.g. for a directory layout like this:

    a / test_whatever.py
    b / test_whatever.py

calling py.path.local("b/test_whatever.py").pyimport() will
fail if the other globally scoped test_whatever module was
loaded already.

--HG--
branch : trunk
2009-10-28 19:51:20 +01:00
holger krekel 84efdacfc0 enabling assertions with jython, fixing one .format occurence
to provide the setting for http://paste.pocoo.org/show/147361/

--HG--
branch : trunk
2009-10-27 21:51:05 +01:00
holger krekel d2e6cd0523 first round of fixing jython compatibility issues, marking some tests as xfail-on-jython
--HG--
branch : trunk
2009-10-27 21:34:11 +01:00
holger krekel 33bd39053f using apipkg 1.0b2 snapshot version - adjusting/cleaning up some impl-detail accesses
--HG--
branch : trunk
2009-10-27 21:31:42 +01:00
holger krekel cc3404b832 merged ronny's nose-compatibility hacks, i.e. nosestyle
setup_module() and setup() functions are supported.
added a few notes to changelog and documentation about it

--HG--
branch : trunk
2009-10-27 16:49:38 +01:00
holger krekel 2b1505c0f3 fix "py.cleanup -d" - add test and check to only remove empty dirs (!)
--HG--
branch : trunk
2009-10-27 16:03:14 +01:00
holger krekel 09ba42a1bb fix bug: a false xfail expression would erranonously report XPASS on failures
--HG--
branch : trunk
2009-10-27 12:02:40 +01:00
holger krekel a161a865c8 remove deprecated parser.addgroup usage in favour of getgroup
--HG--
branch : trunk
2009-10-27 10:03:11 +01:00
Ronny Pfannschmidt 6f80c985fb support nose style argument-free setup/teardown functions
--HG--
branch : trunk
2009-10-23 16:17:06 +02:00
Ronny Pfannschmidt 8e5efa7d6d better tests for the nose plugin, support module level teardown
--HG--
branch : trunk
2009-10-23 15:27:59 +02:00
Ronny Pfannschmidt 82caacd633 nosetest plugin now supports fallback to module level setup
--HG--
branch : trunk
2009-10-23 15:11:53 +02:00
holger krekel 6c2b1c4363 refine naming, API and docs for py.test.mark mechanism - now contained in pytest_mark plugin
--HG--
branch : trunk
2009-10-22 20:57:21 +02:00
holger krekel 861f34fe90 use new marking idioms, simplify generalized skipping implementation
--HG--
branch : trunk
2009-10-22 18:37:24 +02:00
holger krekel 4a76c096da extend and refine test marking
- allow to mark tests via a "pytestmark" name at class/module level.
- make combined positional args of marker calls available via an _args argument

--HG--
branch : trunk
2009-10-22 15:21:58 +02:00
holger krekel 9ac4faf3af don't visit '_' attributes on python objects for calling hooks
--HG--
branch : trunk
2009-10-21 18:44:12 +02:00
holger krekel 9910db2ca6 player nicer for missing parent Module objects for a collected function (bug triggered by oejskit)
--HG--
branch : trunk
2009-10-20 16:38:12 +02:00
holger krekel 80f3e33e41 deprecate addgroup / allow ordering of option groups
--HG--
branch : trunk
2009-10-17 17:43:33 +02:00
holger krekel 3795b08e95 add --report cmdline option, shift refined xfailed and skipped reporting to skipping plugin
--HG--
branch : trunk
2009-10-17 17:42:40 +02:00
holger krekel eab7e039eb streamline pluginmanager api and test/beautify printing of plugins with --trace
--HG--
branch : trunk
2009-10-17 12:56:59 +02:00
holger krekel d8b9b5f1c8 - make importorskip static at py.test.importorskip because it's
used for conditional plugin loading
- fix case where xfail is defined at module/class level
- fixes and improvements to docs, correct links to plugins
- use new skip facilities here and there

--HG--
branch : trunk
2009-10-15 20:10:06 +02:00
holger krekel 3ca770b420 generalize skipping
- rename pytest_xfail to pytest_skip
- dynamic "skipif" and "xfail" decorators
- move most skipping code to the plugin

also coming with this commit:
- extend mark keyword to accept positional args + docs
- fix a few documentation related issues
- leave version as "trunk" for now

--HG--
branch : trunk
2009-10-15 16:18:57 +02:00
holger krekel 5e21e39125 resolve issue 54
triggered by @haypo's issue and patch the
process.cmdexec function now always uses
subprocess under the hood. Also fixed
some 3k related encoding issues.

--HG--
branch : trunk
2009-10-14 23:54:01 +02:00
holger krekel 1bdc0896ca introduce "-d" to py.cleanup
--HG--
branch : trunk
2009-10-12 11:24:41 +02:00
holger krekel 90f39426b4 fix some tests after the py/_py split
--HG--
branch : trunk
2009-10-09 15:26:46 +02:00
holger krekel f10bfbb7e5 resolves #59 - robustify unittest collection
--HG--
branch : trunk
2009-10-09 15:09:26 +02:00
holger krekel 6e11f8cd2a * remove unused py._thread namespace, rewrite the one usage
* remove unused py/test/web directory

--HG--
branch : trunk
2009-10-03 19:57:48 +02:00
holger krekel 5791c06bf2 rewrote the initpkg mechanism and moved py lib implementation files to
_py/...  with py/__init__.py containing pointers into them

The new apipkg is only around 70 lines of code and allows
us to get rid of the infamous "py.__." by regular non-magical
"_py." imports. It is also available as a separately installable
package, see http://bitbucket.org/hpk42/apipkg

--HG--
branch : trunk
2009-10-03 01:47:39 +02:00
holger krekel 1f29529a24 * don't add distributed command line options when 'execnet' is not
installed, report a nice message.

* fix tests and code to work with non-existing execnet

* point execnet doc to the new package

--HG--
branch : trunk
2009-10-02 22:29:22 +02:00
holger krekel ab9f6a75ad remove py.execnet, substitute py.execnet usages with "execnet" ones.
--HG--
branch : trunk
2009-10-02 16:58:57 +02:00
holger krekel 496e3b1138 adding internal repr for debugging
adding an example for generating multi-args/multi python tests

--HG--
branch : trunk
2009-09-30 18:36:04 +02:00
holger krekel aed66120a2 fix typo, add ronny to authors, normalize email addresses
--HG--
branch : trunk
2009-09-30 17:59:03 +02:00
holger krekel 5914277f92 internally rename "provider" to "factory" to be consistent
with documentation.

--HG--
branch : trunk
2009-09-30 12:59:47 +02:00
holger krekel 98b2300266 fix cached_setup to deal properly for test_functions
with multiple args.  closes #50

--HG--
branch : trunk
2009-09-30 12:52:40 +02:00
Ronny Pfannschmidt 2986c5dc74 simplify serializer tests
* use generate_tests to generate the simple non-string checks
* get rid of the TestSerializer class

--HG--
branch : trunk
2009-09-28 23:43:38 +02:00
Benjamin Peterson 7466516673 the check_sequence name is more specific
--HG--
branch : trunk
2009-09-28 15:55:09 -05:00
Ronny Pfannschmidt 2c523cd0d6 enhance the serializer tests
* use generate_tests hook to generate the serialize deserialize combinations
* add dump/load funcargs to simplify the tests

--HG--
branch : trunk
2009-09-28 22:46:32 +02:00
Ronny Pfannschmidt 40e91dcd85 add separate test for the serializer bigint fail
--HG--
branch : trunk
2009-09-28 22:42:36 +02:00
Benjamin Peterson 3d2975f38e support floats
--HG--
branch : trunk
2009-09-26 18:26:32 -05:00
Benjamin Peterson 4d598370b4 test cross version serialization by launching subprocesses; much cleaner!
--HG--
branch : trunk
2009-09-26 12:35:24 -05:00
Benjamin Peterson 1e71a5c392 Add a simple (hopefully) cross-python marshaller
Will rewrite the tests soon...

--HG--
branch : trunk
2009-09-22 21:08:40 -05:00
Benjamin Peterson 8af3ede092 allow a path to explicity given for py.lookup
--HG--
branch : trunk
2009-09-22 21:04:25 -05:00
holger krekel 6ddea4a1bc visit() now returns paths in depth-first order. fixes issue #47
--HG--
branch : trunk
2009-09-22 19:13:33 +02:00
holger krekel e3b34c9da3 * allowing arbitrary keys for xspecs but adding some sanity checks to xspec-parsing and makegateway.
* fixing a python3 IO issue - we need to retain sys.stdout/stdin
  references to keep the underlying byte stream open.

--HG--
branch : trunk
2009-09-22 18:40:20 +02:00
Samuele Pedroni 1b97d06a09 (micke, pedronis)
teach the resultlog plugin about the xfail tweaked outcomes

--HG--
branch : trunk
2009-09-17 15:31:35 +02:00
Benjamin Peterson 81062c5e2f compiling AST to code is new in python 2.6
--HG--
branch : trunk
2009-09-11 15:24:43 -05:00
holger krekel 47bad98c07 * various cleanups and detailed doc string for gateway_base module
* remove old multi-file-send mechanism/tests now that
  only gateway_base is send to the other side.
* adding some (c) notices where i am pretty sure about them.

--HG--
branch : trunk
2009-09-11 16:26:19 +02:00
holger krekel 22c1ad9f7b fix a bug with funcarg setup and remove XXX comment because "scope=module" now would work but leaving it as session for now.
--HG--
branch : trunk
2009-09-09 23:07:42 +02:00
holger krekel 6d84da39e4 some doc about the experiemntal pytest_gwmanage_newgateway hook.
and use process-scope for execnet test funcargs because
of weird setup/teardown issues when running distributedly itself.

--HG--
branch : trunk
2009-09-09 20:45:51 +02:00
holger krekel 5df58c619d * move gateway management code to py/test/dist because it's not clear
how generally useful it is.
* provide pytest_dist_makegateway(txspec) hook so that plugins
  can add their own interpretation/keywords.

--HG--
branch : trunk
2009-09-09 20:12:03 +02:00
holger krekel 8ea2364039 ups, forgot to add a neccessary file.
--HG--
branch : trunk
2009-09-09 15:36:53 +02:00
holger krekel b70c7a209d * moving execnet tests to funcarg-style, some cleanup
* slight refinement to FAQ license topic

--HG--
branch : trunk
2009-09-08 10:10:36 +02:00
holger krekel 0f29b503ef monkeypatch, doc, apiwarn, deprecation fixes
--HG--
branch : trunk
2009-09-07 17:53:50 +02:00
holger krekel 29d437489d some fixes to support Jython better
--HG--
branch : trunk
2009-09-07 14:59:26 +02:00
holger krekel c8119d89b6 move test files out of py lib proper
* separate all tests from plugins
* simplify implicit inclusion of plugins under test
* have test_initpkg perform direct checks instead of yielding tests
* fix example tests for 3k

--HG--
branch : trunk
2009-09-06 16:59:39 +02:00