Commit Graph

6249 Commits

Author SHA1 Message Date
Bruno Oliveira 25371ddbfd Merge pull request #2315 from RonnyPfannschmidt/namespace-hook
remove pytest internal usage of the namespace hook
2017-04-21 16:24:20 -03:00
Ronny Pfannschmidt 80cabca21a Merge pull request #2292 from nicoddemus/defer-hook-checking
Verify hooks after collection completes
2017-04-19 13:04:03 +02:00
Bruno Oliveira cac82e71d8 Improve item.warn handling of fslocation parameter
Just pass fslocation forward and let the hook implementer decide what to do with the parameter
2017-04-13 19:01:14 -03:00
Bruno Oliveira d9a2e70155 Change LsofFdLeakChecker to emit a warning instead of failing when detecting leaked FDs
Related to #2366
2017-04-13 17:34:48 -03:00
Bruno Oliveira 731776702d Fix hook name in LsofFdLeakChecker 2017-04-11 21:55:12 -03:00
Bruno Oliveira 0baf5e1499 Fix test that expected "unknown hook" error on stderr 2017-04-11 21:55:12 -03:00
Bruno Oliveira 83c508eea3 Verify hooks after collection completes
Fix #1821
2017-04-11 21:55:12 -03:00
Bruno Oliveira 78ac1bf5d1 Merge pull request #2350 from nicoddemus/future-imports-rewrite
Ensure rewritten modules don't inherit __future__ flags from pytest
2017-04-11 20:59:05 -03:00
Bruno Oliveira 02da278894 Merge pull request #2357 from ojii/lastfailed-failedfirst
Changed behavior if --lf and --ff are both used.
2017-04-11 19:05:01 -03:00
Bruno Oliveira 1125786e78 Improve --lf/--ff test as commented during review 2017-04-11 17:55:55 -03:00
Jonas Obrist 08d83a5c6a updated changelog and authors files 2017-04-10 17:50:18 +09:00
Jonas Obrist 0ab85e7a9c Changed behavior if --lf and --ff are both used.
When using both --last-failed/--lf and --failed-first/--ff pytest would
run all tests with failed tests first (as if --lf was not provied). This
patch changes it so that when using both flags, only the last failed
tests are run. This makes it easier to set --ff as the default behavior
via the config file and then selectively use --lf to only run the last
failed tests.
2017-04-10 17:46:13 +09:00
Bruno Oliveira 1b5f898dc5 Ensure rewritten modules don't inherit __future__ flags from pytest
In a recent refactoring we enabled all __future__ features in pytest
modules, but that has the unwanted side effect of propagating those
features to compile()'d modules inside assertion rewriting, unless
we pass dont_inherit=False to compile().
2017-04-06 15:00:36 -03:00
Ronny Pfannschmidt 83b241b449 Merge pull request #2347 from reutsharabani/features
added option to unicode plugin name
2017-04-06 18:16:20 +02:00
Bruno Oliveira 24ac923938 Add CHANGELOG entry 2017-04-06 12:42:17 -03:00
reut 333ce9849d added acceptance test for unicode plugin names 2017-04-06 10:54:47 +00:00
reut 417b54abed added option to unicode plugin name 2017-04-05 13:03:11 +00:00
Ronny Pfannschmidt afb1778294 put in a singular namespace hook to work around the strange issue 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt ebeba79be3 remove the namespace hook from mark after the param feature merge 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 6165939b0d fix rebase mistakes 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt efe03400d8 fixup nose/pytest plugins 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt c9ab421398 fix python2 only import loop failure 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 147bb8aea5 correct setting pytest.config 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 7cdefce656 fix up oversights 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 4d31ea8316 add a comment explaining the modimport tests 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt bb750a7945 add missed file 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 92f6ab1881 fix all singular internal module imports and add a test for them 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 809c36e1f6 add a changelog note for pytest_namespace 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 23bc9815c4 remove pytest_namespace from _pytest.fixtures 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt ae234786ea remove pytest_namespace from _pytest.python 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 99c8f2d403 remove pytest_namespace from _pytest.main 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 61f418a267 hollow out pytest_namespace in _pytest.fixtures 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 9b58d6eaca prepare a own pytest.collect fake module in oder to remove the nested builtin namespaces 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 839c936153 _pytest.mark: fix unconfigure after bad configure, still potential bug 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 7d797b7dbf add a note about the deprecation of the pytest_namespace hook 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 9b755f6ec6 remove pytest_namespace from _pytest.skipping 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 90788defb2 remove pytest_namespace from _pytest.mark and fix latent pytest nesting bug 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 6a02cdbb35 remove pytest_namespace from _pytest/runner.py 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt c74103f395 remove pytest_namespace from recwarn and fixture decorators 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 794fd5658c remove pytest_namespace from _pytest/debugging.py 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt fab9b993f8 remove pytest_namespace from _pytest.freeze_support 2017-03-28 11:45:06 +02:00
Ronny Pfannschmidt 5818e65cf3 remove pytest_namespace from _pytest/assertion 2017-03-28 11:35:29 +02:00
Ronny Pfannschmidt 2a130daae6 Merge pull request #2072 from nicoddemus/integrate-pytest-warnings
Integrate pytest warnings
2017-03-22 17:10:04 +01:00
Bruno Oliveira 0c1c2580d0 Add CHANGELOG entry 2017-03-22 12:40:31 -03:00
Bruno Oliveira 74b54ac0ec Fix errors related to warnings raised on pypy test environment
For some reason pypy raises this warning in the line that the catch_warnings block was added:

______________________________ ERROR collecting  ______________________________
C:\ProgramData\chocolatey\lib\python.pypy\tools\pypy2-v5.4.1-win32\lib-python\2.7\pkgutil.py:476: in find_loader
    loader = importer.find_module(fullname)
c:\pytest\.tox\pypy\site-packages\_pytest\assertion\rewrite.py:75: in find_module
    fd, fn, desc = imp.find_module(lastname, path)
<builtin>/?:3: in anonymous
    ???
E   ImportWarning: Not importing directory 'c:\users\bruno\appdata\local\temp\pytest-of-Bruno\pytest-3192\testdir\test_cmdline_python_package0' missing __init__.py
2017-03-21 22:32:41 -03:00
Bruno Oliveira 2c730743f1 Fix errors related to warnings raised by xdist
- pytester was creating a 'pexpect' directory to serve as temporary dir, but due to the fact that
   xdist adds the current directory to sys.path, that directory was being considered as candidate
   for import as a package. The directory is empty and a warning was being raised about
   it missing __init__ file, which is now turned into an error by our filterwarnings config
   in pytest.ini.

- Decided to play it safe and ignore any warnings during `pytest.importorskip`.

- pytest-xdist and execnet raise two warnings which should be fixed upstream:
   pytest-dev/pytest-xdist/issues/133
2017-03-21 22:17:07 -03:00
Bruno Oliveira 916d272c44 Fix test on linux 2017-03-20 23:44:50 -03:00
Bruno Oliveira eabe3eed6b Add docs for the warnings functionality 2017-03-20 23:35:01 -03:00
Bruno Oliveira fa56114115 Clean up warnings generated by pytest's own suite 2017-03-20 22:13:17 -03:00
Bruno Oliveira d027f760c0 Avoid displaying the same warning multiple times for an item 2017-03-20 20:40:53 -03:00