Merge pull request #3279 from nicoddemus/introduce-more_itertools
Re-Introduce more_itertools
This commit is contained in:
commit
9879ac5911
|
@ -1,3 +1,4 @@
|
||||||
|
""" Access and control log capturing. """
|
||||||
from __future__ import absolute_import, division, print_function
|
from __future__ import absolute_import, division, print_function
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
|
|
@ -177,7 +177,7 @@ def _in_venv(path):
|
||||||
"""Attempts to detect if ``path`` is the root of a Virtual Environment by
|
"""Attempts to detect if ``path`` is the root of a Virtual Environment by
|
||||||
checking for the existence of the appropriate activate script"""
|
checking for the existence of the appropriate activate script"""
|
||||||
bindir = path.join('Scripts' if sys.platform.startswith('win') else 'bin')
|
bindir = path.join('Scripts' if sys.platform.startswith('win') else 'bin')
|
||||||
if not bindir.exists():
|
if not bindir.isdir():
|
||||||
return False
|
return False
|
||||||
activates = ('activate', 'activate.csh', 'activate.fish',
|
activates = ('activate', 'activate.csh', 'activate.fish',
|
||||||
'Activate', 'Activate.bat', 'Activate.ps1')
|
'Activate', 'Activate.bat', 'Activate.ps1')
|
||||||
|
|
|
@ -2,7 +2,8 @@ import math
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
import py
|
import py
|
||||||
from six.moves import zip
|
from six.moves import zip, filterfalse
|
||||||
|
from more_itertools.more import always_iterable
|
||||||
|
|
||||||
from _pytest.compat import isclass
|
from _pytest.compat import isclass
|
||||||
from _pytest.outcomes import fail
|
from _pytest.outcomes import fail
|
||||||
|
@ -566,14 +567,10 @@ def raises(expected_exception, *args, **kwargs):
|
||||||
|
|
||||||
"""
|
"""
|
||||||
__tracebackhide__ = True
|
__tracebackhide__ = True
|
||||||
|
for exc in filterfalse(isclass, always_iterable(expected_exception)):
|
||||||
msg = ("exceptions must be old-style classes or"
|
msg = ("exceptions must be old-style classes or"
|
||||||
" derived from BaseException, not %s")
|
" derived from BaseException, not %s")
|
||||||
if isinstance(expected_exception, tuple):
|
|
||||||
for exc in expected_exception:
|
|
||||||
if not isclass(exc):
|
|
||||||
raise TypeError(msg % type(exc))
|
raise TypeError(msg % type(exc))
|
||||||
elif not isclass(expected_exception):
|
|
||||||
raise TypeError(msg % type(expected_exception))
|
|
||||||
|
|
||||||
message = "DID NOT RAISE {0}".format(expected_exception)
|
message = "DID NOT RAISE {0}".format(expected_exception)
|
||||||
match_expr = None
|
match_expr = None
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
Add logging plugin to plugins list.
|
|
@ -0,0 +1,2 @@
|
||||||
|
Refactor check of bindir from ``exists`` to ``isdir`` regarding `#3241 <https://github.com/pytest-dev/pytest/issues/3241>`_.
|
||||||
|
|
|
@ -0,0 +1 @@
|
||||||
|
``pytest`` now depends on the `more_itertools <https://github.com/erikrose/more-itertools>`_ package.
|
|
@ -148,6 +148,7 @@ in the `pytest repository <https://github.com/pytest-dev/pytest>`_.
|
||||||
_pytest.resultlog
|
_pytest.resultlog
|
||||||
_pytest.runner
|
_pytest.runner
|
||||||
_pytest.main
|
_pytest.main
|
||||||
|
_pytest.logging
|
||||||
_pytest.skipping
|
_pytest.skipping
|
||||||
_pytest.terminal
|
_pytest.terminal
|
||||||
_pytest.tmpdir
|
_pytest.tmpdir
|
||||||
|
|
1
setup.py
1
setup.py
|
@ -60,6 +60,7 @@ def main():
|
||||||
'six>=1.10.0',
|
'six>=1.10.0',
|
||||||
'setuptools',
|
'setuptools',
|
||||||
'attrs>=17.4.0',
|
'attrs>=17.4.0',
|
||||||
|
'more_itertools>=4.0.0',
|
||||||
]
|
]
|
||||||
# if _PYTEST_SETUP_SKIP_PLUGGY_DEP is set, skip installing pluggy;
|
# if _PYTEST_SETUP_SKIP_PLUGGY_DEP is set, skip installing pluggy;
|
||||||
# used by tox.ini to test with pluggy master
|
# used by tox.ini to test with pluggy master
|
||||||
|
|
Loading…
Reference in New Issue