Commit Graph

64 Commits

Author SHA1 Message Date
Anthony Sottile 3f1ec520fc pre-commit run reorder-python-imports --all-files 2019-06-03 12:08:01 -03:00
Anthony Sottile 5034399d7a pre-commit run fix-encoding-pragma --all-files 2019-06-03 12:08:01 -03:00
Anthony Sottile dc75b6af47 Use fix-encoding-pragma pre-commit hook 2019-05-14 15:56:31 -07:00
Bruno Oliveira 7573747cda Normalize all source encoding declarations 2019-05-14 19:42:44 -03:00
Daniel Hahler 8c734dfc2f Split out list of essential plugins
Fixes https://github.com/pytest-dev/pytest/issues/4976.
2019-04-02 14:39:56 +02:00
Daniel Hahler 4e931b258d Merge master into features 2019-03-29 11:05:46 +01:00
Daniel Hahler d17ea7a9c0 tests: ensure cleanup with configs via get_config()
Also done in test_pluginmanager, although no resource warnings are
there at least.

Fixes https://github.com/pytest-dev/pytest/issues/4355.
2019-03-28 00:14:13 +01:00
Daniel Hahler fd64fa1863 Revisit test_importplugin_error_message
Should be more helpful in case of errors than before:

    >       assert re.match(expected_message, str(excinfo.value))
    E       _pytest.warning_types.PytestWarning: asserting the value None, please use "assert is None"

    https://travis-ci.org/pytest-dev/pytest/jobs/509970576#L208
2019-03-22 17:02:26 +01:00
Daniel Hahler ea2c6b8a88 config: fix consider_preparse with missing argument to -p
This is only required after/with 415899d4 - otherwise argparse ensures
there is an argument already.
2019-03-21 17:05:22 +01:00
Daniel Hahler 15fe8c6e90 Handle `-p plug` after `-p no:plug`.
This can be used to override a blocked plugin (e.g. in "addopts") from the
command line etc.
2019-03-16 15:58:00 +01:00
Bruno Oliveira fd48cd57f9 Remove config.warn, Node.warn; pytest_logwarning issues a warning when implemented
Fix #3078
2018-12-14 12:50:18 -02:00
Daniel Hahler 7b1cb885c7 Handle missing space with -p
This still does not use an actual argument parser, which only gets
instantiated below, and it does not appear to make sense instantiating
it just for this pre-parsing it seems.

`-p` without the required value is being handled before already though,
so it could potentially be passed down from somewhere already?!

Fixes https://github.com/pytest-dev/pytest/issues/3532.
2018-12-11 04:27:03 +01:00
Anthony Sottile 1bba0a9714 Deprecate `raises(..., 'code(as_a_string)')` / `warns(..., 'code(as_a_string)') 2018-11-29 09:34:51 -08:00
Ronny Pfannschmidt ba17363d75 remove pytest namespace hook 2018-11-19 14:04:41 +01:00
Bruno Oliveira 17b8e2d45b Fix linting 2018-11-07 18:32:23 -02:00
Fabien ZARIFIAN a447dc86fb
Add test to branch 2018-11-05 00:14:35 +01:00
Anthony Sottile 2368fbb63c Apply reorder-python-imports to all files 2018-10-25 00:01:29 -07:00
Bruno Oliveira f872fcb5d0 Remove dangerous sys.path manipulations in test_pluginmanager
Noticed these while working in something else
2018-08-25 17:33:29 -03:00
Bruno Oliveira cf6d8e7e53 Fix test and update warning in pytest_namespace docs 2018-07-30 12:16:42 -03:00
Anthony Sottile cbaa7dd56a Upgrade pre-commit hooks except pyupgrade 2018-06-26 06:35:27 -07:00
Ronny Pfannschmidt 703e4b11ba run black 2018-05-23 16:48:46 +02:00
Anthony Sottile bd1d17e8de Replace py.std with stdlib imports 2018-01-09 12:44:10 -08:00
Bruno Oliveira 983a09a2d4 Merge remote-tracking branch 'upstream/master' into merge-master-into-features 2017-11-10 18:33:02 -02:00
Bruno Oliveira 03829fde8a Fix linting E741: ambiguous variable name 2017-11-04 13:59:10 -02:00
Ofir c89827b9f2 updating import plugin error test in order to make sure it also checks that the original traceback has been shown to the users 2017-09-19 15:23:07 +03:00
Bruno Oliveira 3dc0da9339 Remove __multicall__ warning and usages in testing
pluggy>=0.5 already warns about those
2017-09-01 18:53:06 -03:00
Andras Tim b840622819 Fixed E302 flake8 errors
expected 2 blank lines, found 0
2017-07-17 01:44:23 +02:00
Andras Tim 195a816522 Fixed E265 flake8 errors
block comment should start with ‘# ‘
2017-07-17 01:44:22 +02:00
Andras Tim cf97159009 Fixed E128 flake8 errors
continuation line under-indented for visual indent
2017-07-17 01:28:16 +02:00
Andras Tim e855a79dd4 Fixed E126 flake8 errors
continuation line over-indented for hanging indent
2017-07-17 01:28:16 +02:00
Bruno Oliveira 9f85584656 Merge remote-tracking branch 'upstream/features' into integrate-pytest-warnings 2017-03-20 19:59:05 -03:00
Bruno Oliveira 42a5d6bdfa Add __future__ imports to all pytest modules
This prevents silly errors from creeping in Python 2 when testing in Python 3
2017-03-16 22:45:40 -03:00
Bruno Oliveira 337f891d78 Fixed tests 2017-03-16 20:01:47 -03:00
Michal Wajszczuk fb0b90646e New-style classes implemented for python 2.7 - #2147 2017-02-16 20:28:17 +01:00
Bruno Oliveira 81528ea81f Remove hook proxy cache
Fix #2016
2016-12-02 07:32:11 -02:00
Bruno Oliveira 1eb5a690d4 Fix flake8 E305 and E306 errors
These errors started to appear with flake8-3.1.1, while they don't appear with
version 3.1.0 (weird).
2016-11-20 18:59:15 -02:00
Bruno Oliveira 78eec0d7f8 Handle import errors with non-ascii messages when importing plugins
Fix #1998
2016-10-12 18:19:32 -03:00
Bruno Oliveira 7a186df271 Improve error message when a plugin fails to import 2016-03-08 19:18:13 -03:00
Simon Gomizelj b3727438d6 Add missing nodeid on pytest_logwarning call in addhook.
Otherwise KeyError: 'nodeid' gets thrown, killing pytest. This may fix
issue 1034, but the details of it may be caused by something similar
somewhere else.
2015-09-28 20:23:54 -04:00
Ronny Pfannschmidt 76f0988551 turn the pytest_logwarning hook historic 2015-09-02 18:49:49 +02:00
Bruno Oliveira 2ffd37b816 return non-zero exit code if no tests are collected
Fix #812
Fix #500
2015-08-18 07:35:02 -03:00
holger krekel 5ee7ee0850 adapt pytest to using pluggy (current master)
--HG--
branch : pluggy1
2015-04-29 16:40:51 +02: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 53d1cfc3a1 allow unregistration by name 2010-11-01 09:20:58 +01:00
holger krekel c3ec2718a2 fix tests by using less likely existing import names 2010-11-01 00:38:44 +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 35969e13ae remove feature deprecated prior even to 1.0 2010-10-31 18:46:10 +01: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 6631447161 merge config, pluginmanager, main into one file
--HG--
branch : trunk
2010-10-12 12:54:32 +02:00