Commit Graph

3326 Commits

Author SHA1 Message Date
holger krekel 407283ef81 a new monkeypatch.replace(target, value) call which derives the
monkeypatch location from target (can be class/module/function or
string which is taken as importable python path)
examples:

    monkeypatch.replace(os.path.abspath, lambda x: "")
    monkeypatch.replace("requests.get", ...)
2013-08-07 15:35:27 +02:00
holger krekel 3fddf99661 Merged in anthon_van_der_neut/pytest_argcomplete (pull request #63)
argcomplete: FastFileCompleter that doesn't call bash in subprocess, strip prefix dir
2013-08-06 15:41:54 +02:00
holger krekel 21f72b7163 Merged in pelme/pytest/quiet-color-summary (pull request #61)
Added color to the quite mode summary
2013-08-06 15:38:43 +02:00
Anthon van der Neut 719e89fc1a argcomplete: FastFileCompleter that doesn't call bash in subprocess, strip prefix dir
```
timeit result for 10000 iterations of expanding '/d' (lowered the count in the code afterwards)
#                      2.7.5     3.3.2
# FilesCompleter       75.1109   69.2116
# FastFilesCompleter    0.7383    1.0760
```
- does not display prefix dir (like bash, not like compgen), py.test /usr/<TAB> does not show /usr/bin/ but bin/
2013-08-06 15:33:27 +02:00
Andreas Pelme afa88a479b Added color to the quite mode summary. Also changed the output format
slightly to match the output of the standard summary.

--HG--
branch : quiet-color-summary
2013-08-05 09:45:10 +02:00
holger krekel 7d86827b5e ref #322 cleanup all teardown calling to only happen when setup succeeded.
don't use autouse fixtures for now because it would cause a proliferation
and overhead for the execution of every test.  Rather introduce a
node.addfinalizer(fin) to attach a finalizer to the respective node
and call it from node.setup() functions if the setup phase succeeded
(i.e. there is no setup function or it finished successfully)
2013-08-02 09:52:40 +02:00
holger krekel b2ebb80878 fix issue322: tearDownClass is not run if setUpClass failed. Thanks
Mathieu Agopian for fixing.  The patch moves handling setUpClass
into a new autofixture. (XXX impl-decide if rather adding addfinalizer()
API to node's would have a similar effect)
2013-08-02 00:02:28 +02:00
Mathieu Agopian 7fc0d45a4c refs #322: setUpClass and tearDownClass as autouse fixture and finalizer 2013-08-01 23:48:40 +02:00
Ronny Pfannschmidt 3b85a56db2 merge 2013-08-01 22:55:16 +02:00
Ronny Pfannschmidt 743711cd1f fix issue317: assertion rewriter support for the is_package method 2013-08-01 22:11:18 +02:00
Floris Bruynooghe cfe1d4f7c9 mention fix for issue 336 in changelog 2013-08-01 19:03:53 +01:00
Floris Bruynooghe 2cdb54225c Fix issue 336: autouse fixtures in plugins work again
When an autouse fixture in a plugin was encountered None was stored as nodeid
where it used to be ''.  This broke the lookup of autouse fixtures later on.

This also adds another test for the normal fixture ordering which was slightly
wrong: a fixture without location was always added at the front of the fixture
list rather then at the end of the fixtures without location but before the
fixtures with location.
2013-08-01 18:58:28 +01:00
holger krekel 8f24e10571 add changelog entry for anthon's hynek-fication of options,
and change the docs and tests to use the new style.
2013-08-01 17:32:19 +02:00
holger krekel 3ac36f6572 Merged in anthon_van_der_neut/pytest/opt-drop-non-hyphened-long-options (pull request #57)
changes to addoption() for hyphenated long-options
2013-08-01 17:04:18 +02:00
Anthon van der Neut e96da76c3b changes to addoption() for hyphenated long-options
--HG--
branch : opt-drop-non-hyphened-long-options
2013-08-01 16:49:26 +02:00
holger krekel ca6f3d24c3 Merged in anthon_van_der_neut/pytest/opt-drop-non-hyphened-long-options (pull request #56)
drop help for long options if longer versions with hyphens are available
2013-08-01 16:33:50 +02:00
Anthon van der Neut e24b56af6c removed two superfluous parser arguments
--HG--
branch : opt-drop-non-hyphened-long-options
2013-08-01 16:27:06 +02:00
Anthon van der Neut 007a77c2ba drop help for long options if longer versions with hyphens are available
--HG--
branch : opt-drop-non-hyphened-long-options
2013-08-01 16:21:33 +02:00
Floris Bruynooghe 18fa7d866d Close issue 279: improved assertrepr_compare 2013-08-01 15:02:58 +01:00
holger krekel 9ccd52d538 fix issue305 - ignore any problems in writing a pyc file, but print out a trace. 2013-08-01 15:43:42 +02:00
holger krekel cbbbfcd101 fix collection imports for python2.5 2013-08-01 15:38:03 +02:00
Mathieu Agopian 72a48d69cd refs #279: sequence assertions can also deal with (Mutable)Sequence instances 2013-08-01 14:48:34 +02:00
holger krekel 7e4b21e9a7 merge 2013-08-01 14:45:24 +02:00
holger krekel b90d82c17f fix some py33 issues introduced with rev 2985
--HG--
branch : argcomplete
2013-08-01 14:24:25 +02:00
holger krekel b60a8c12d5 fix Mathieu's name. 2013-08-01 12:12:09 +02:00
holger krekel a24c7b42f1 add changelog entry for fixed issue 335. 2013-08-01 11:36:05 +02:00
Mathieu Agopian 0350a1929d merge 2013-08-01 11:20:30 +02:00
Mathieu Agopian 99783b6fba refs #335: clarify that the exception info returned by pytest.raises is a py.code.ExceptionInfo() 2013-08-01 11:19:47 +02:00
Mathieu Agopian 0e3abdc1af Merged hpk42/pytest into default 2013-08-01 11:12:59 +02:00
Mathieu Agopian 905c648b99 fixes #335: document ExceptionInfo returned by pytest.raises 2013-08-01 11:12:02 +02:00
holger krekel b81c257360 small mod to test BND 2013-08-01 10:59:45 +02:00
holger krekel 64e9956770 plugin versions are displayed now. 2013-08-01 10:57:36 +02:00
holger krekel 2385553790 no funcargs for setup functions, rather use autouse fixtures. 2013-08-01 10:43:02 +02:00
holger krekel 4c6a11b8e1 remove an old issue. 2013-08-01 10:40:55 +02:00
holger krekel 1111d5b26b remove an entry 2013-08-01 10:37:45 +02:00
holger krekel 44d5524be2 Merged in anthon_van_der_neut/pytest/argcomplete (pull request #51)
fix for tests running subprocesses of py.test after test_argcomplete
2013-08-01 10:30:24 +02:00
holger krekel 1023390f53 fix issue334: don't recommend distribute but setuptools everywhere, also remove implicit distribute_setup support from setup.py. 2013-08-01 09:42:44 +02:00
holger krekel 02199c218d add license note to README 2013-08-01 09:31:34 +02:00
holger krekel 46901fb813 fix issue338: honor --tb style for setup/teardown errors as well. Thanks Maho.
(this is just changing the CHANGELOG entry because the bug was already fixed earlier)
2013-08-01 07:43:00 +02:00
Anthon van der Neut ef2ddb6f16 monkeypatch for os.environment changes
--HG--
branch : argcomplete
2013-07-31 21:33:13 +02:00
Anthon van der Neut e3a2e1bbf8 fix for tests running subprocesses of py.test after test_argcomplete
(which all still ran with argcompletion enabled) -> fail

--HG--
branch : argcomplete
2013-07-31 16:03:53 +02:00
holger krekel 8a0a880294 Merged in anthon_van_der_neut/pytest/argcomplete (pull request #50)
Fixes for argcomplete
2013-07-31 07:51:07 +02:00
Anthon van der Neut 6817a56270 minor adjustment, added test for positional argument completion
--HG--
branch : argcomplete
2013-07-30 12:33:38 +02:00
Anthon van der Neut 87860600fb Fixes for argcomplete
- separate out most argcomplete related stuff in new file _argcomplete.py
  (could probably be in the py library)
- allow positional arguments to be interspaced with optional arguments
  ( + test in test_parseopt.py )
- removed double argument in tox.ini
- add documentation on installing argcomplete (>=0.5.7 as needed for
  Python 3), might need improving/incorporation in index.

This does not work on 2.5 yet. I have patches for argcomplete
(with/print()/"".format) but I am not sure they will be accepted.
Agreed with hpk not to push for that.

Removing argcomplete and leaving completion code active now works by early
exit, so <TAB> no longer re-runs the programs without parameters
(which took long for py.test)

test calls bash with a script that redirects filedescriptor 8 (as used by
argcomplete), so the result can be tested.

--HG--
branch : argcomplete
2013-07-30 11:26:15 +02:00
holger krekel 377f63085a be more liberal with respect to lsof checks because jenkins keeps some files open 2013-07-29 15:39:24 +02:00
holger krekel 2a7c79dbf5 make genscript provide information as to compatibility
(now that argparse is a dependency on python2.6)
2013-07-26 08:59:31 +02:00
holger krekel 7a8134660f merge doc changes 2013-07-26 08:59:29 +02:00
holger krekel 863a255c9d Merged in anthon_van_der_neut/pytest/tox_reference (pull request #47)
update for links to tox
2013-07-26 08:59:12 +02:00
Anthon van der Neut 9b51105afa also update testrun.org in 日本語
--HG--
branch : tox_reference
2013-07-26 08:20:26 +02:00
Anthon van der Neut 4b56b075c1 updated tox to live on testrun.org (the old links are still
working on codespeak.net, but those docs are outdated)

--HG--
branch : tox_reference
2013-07-26 08:14:49 +02:00