Skip to content

Commit f79b032

Browse files
Merge pull request #3387 from nicoddemus/merge-master-into-features
Merge master into features
2 parents 372bcdb + 10a7160 commit f79b032

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+107
-126
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ Tareq Alayan
190190
Ted Xiao
191191
Thomas Grainger
192192
Thomas Hisch
193+
Tim Strazny
193194
Tom Dalton
194195
Tom Viner
195196
Trevor Bekolay

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion

_pytest/assertion/util.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
import _pytest._code
66
import py
77
import six
8-
from collections import Sequence
8+
from ..compat import Sequence
99

1010
u = six.text_type
1111

_pytest/compat.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,14 @@
3838
PY36 = sys.version_info[:2] >= (3, 6)
3939
MODULE_NOT_FOUND_ERROR = 'ModuleNotFoundError' if PY36 else 'ImportError'
4040

41+
if _PY3:
42+
from collections.abc import MutableMapping as MappingMixin # noqa
43+
from collections.abc import Sequence # noqa
44+
else:
45+
# those raise DeprecationWarnings in Python >=3.7
46+
from collections import MutableMapping as MappingMixin # noqa
47+
from collections import Sequence # noqa
48+
4149

4250
def _format_args(func):
4351
return str(signature(func))

_pytest/hookspec.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -413,14 +413,15 @@ def pytest_fixture_post_finalizer(fixturedef, request):
413413

414414

415415
def pytest_sessionstart(session):
416-
""" before session.main() is called.
416+
""" called after the ``Session`` object has been created and before performing collection
417+
and entering the run test loop.
417418
418419
:param _pytest.main.Session session: the pytest session object
419420
"""
420421

421422

422423
def pytest_sessionfinish(session, exitstatus):
423-
""" whole test run finishes.
424+
""" called after whole test run finished, right before returning the exit status to the system.
424425
425426
:param _pytest.main.Session session: the pytest session object
426427
:param int exitstatus: the status which pytest will return to the system

_pytest/junitxml.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -245,11 +245,6 @@ def record_property(request):
245245
def test_function(record_property):
246246
record_property("example_key", 1)
247247
"""
248-
request.node.warn(
249-
code='C3',
250-
message='record_property is an experimental feature',
251-
)
252-
253248
def append_property(name, value):
254249
request.node.user_properties.append((name, value))
255250
return append_property

_pytest/mark/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ class MarkerError(Exception):
2020

2121

2222
def param(*values, **kw):
23-
"""Specify a parameter in a `pytest.mark.parametrize`_ call.
23+
"""Specify a parameter in `pytest.mark.parametrize`_ calls or
24+
:ref:`parametrized fixtures <fixture-parametrize-marks>`.
2425
2526
.. code-block:: python
2627

_pytest/mark/structures.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
from collections import namedtuple, MutableMapping as MappingMixin
1+
import inspect
22
import warnings
3+
from collections import namedtuple
34
from operator import attrgetter
4-
import inspect
55

66
import attr
77

88
from ..deprecated import MARK_PARAMETERSET_UNPACKING, MARK_INFO_ATTRIBUTE
9-
from ..compat import NOTSET, getfslineno
9+
from ..compat import NOTSET, getfslineno, MappingMixin
1010
from six.moves import map, reduce
1111

1212

_pytest/python_api.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import sys
33

44
import py
5+
from six import binary_type, text_type
56
from six.moves import zip, filterfalse
67
from more_itertools.more import always_iterable
78

@@ -584,7 +585,8 @@ def raises(expected_exception, *args, **kwargs):
584585
585586
"""
586587
__tracebackhide__ = True
587-
for exc in filterfalse(isclass, always_iterable(expected_exception)):
588+
base_type = (type, text_type, binary_type)
589+
for exc in filterfalse(isclass, always_iterable(expected_exception, base_type)):
588590
msg = ("exceptions must be old-style classes or"
589591
" derived from BaseException, not %s")
590592
raise TypeError(msg % type(exc))
@@ -597,6 +599,10 @@ def raises(expected_exception, *args, **kwargs):
597599
message = kwargs.pop("message")
598600
if "match" in kwargs:
599601
match_expr = kwargs.pop("match")
602+
if kwargs:
603+
msg = 'Unexpected keyword arguments passed to pytest.raises: '
604+
msg += ', '.join(kwargs.keys())
605+
raise TypeError(msg)
600606
return RaisesContext(expected_exception, message, match_expr)
601607
elif isinstance(args[0], str):
602608
code, = args

changelog/1478.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/1642.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/1713.doc.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2370.bugfix.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2405.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/2770.feature

Lines changed: 0 additions & 2 deletions
This file was deleted.

changelog/2770.removal.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3034.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3084.removal

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3139.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3149.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3156.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3189.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3190.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3198.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3204.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3213.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3228.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3236.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3245.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3246.trival.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3250.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3255.feature.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3265.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3268.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3291.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3292.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3296.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3296.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3297.bugfix.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

changelog/3304.trivial

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3308.trivial.rst

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3312.feature

Lines changed: 0 additions & 1 deletion
This file was deleted.

changelog/3314.bugfix.rst

Lines changed: 0 additions & 3 deletions
This file was deleted.

changelog/3339.trivial

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Import some modules from ``collections`` instead of ``collections.abc`` as the former modules trigger ``DeprecationWarning`` in Python 3.7.

changelog/3348.bugfix.rst

Lines changed: 1 addition & 0 deletions

changelog/3360.trivial

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
record_property is no longer experimental, removing the warnings was forgotten.
2+

changelog/3372.bugfix.rst

Lines changed: 1 addition & 0 deletions

doc/en/development_guide.rst

Lines changed: 9 additions & 62 deletions

doc/en/example/reportingdemo.rst

Lines changed: 1 addition & 1 deletion

doc/en/fixture.rst

Lines changed: 35 additions & 1 deletion

doc/en/reference.rst

Lines changed: 2 additions & 0 deletions

doc/en/writing_plugins.rst

Lines changed: 2 additions & 2 deletions

setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ def main():
6060
'six>=1.10.0',
6161
'setuptools',
6262
'attrs>=17.4.0',
63-
'more_itertools>=4.0.0',
63+
'more-itertools>=4.0.0',
6464
]
6565
# if _PYTEST_SETUP_SKIP_PLUGGY_DEP is set, skip installing pluggy;
6666
# used by tox.ini to test with pluggy master

0 commit comments

Comments
 (0)