Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update pytest to 3.6.2 #122

Closed
wants to merge 1 commit into from
Closed

Conversation

pyup-bot
Copy link
Collaborator

This PR updates pytest from 3.4.0 to 3.6.2.

Changelog

3.6.1

=========================

Bug Fixes
---------

- Fixed a bug where stdout and stderr were logged twice by junitxml when a test
was marked xfail. (`3491
<https://github.com/pytest-dev/pytest/issues/3491>`_)

- Fix ``usefixtures`` mark applyed to unittest tests by correctly instantiating
``FixtureInfo``. (`3498
<https://github.com/pytest-dev/pytest/issues/3498>`_)

- Fix assertion rewriter compatibility with libraries that monkey patch
``file`` objects. (`3503
<https://github.com/pytest-dev/pytest/issues/3503>`_)


Improved Documentation
----------------------

- Added a section on how to use fixtures as factories to the fixture
documentation. (`3461 <https://github.com/pytest-dev/pytest/issues/3461>`_)


Trivial/Internal Changes
------------------------

- Enable caching for pip/pre-commit in order to reduce build time on
travis/appveyor. (`3502
<https://github.com/pytest-dev/pytest/issues/3502>`_)

- Switch pytest to the src/ layout as we already suggested it for good practice
- now we implement it as well. (`3513
<https://github.com/pytest-dev/pytest/issues/3513>`_)

- Fix if in tests to support 3.7.0b5, where a docstring handling in AST got
reverted. (`3530 <https://github.com/pytest-dev/pytest/issues/3530>`_)

- Remove some python2.5 compatibility code. (`3529
<https://github.com/pytest-dev/pytest/issues/3529>`_)

3.6.0

=========================

Features
--------

- Revamp the internals of the ``pytest.mark`` implementation with correct per
node handling which fixes a number of long standing bugs caused by the old
design. This introduces new ``Node.iter_markers(name)`` and
``Node.get_closest_mark(name)`` APIs. Users are **strongly encouraged** to
read the `reasons for the revamp in the docs
<https://docs.pytest.org/en/latest/mark.htmlmarker-revamp-and-iteration>`_,
or jump over to details about `updating existing code to use the new APIs
<https://docs.pytest.org/en/latest/mark.htmlupdating-code>`_. (`3317
<https://github.com/pytest-dev/pytest/issues/3317>`_)

- Now when ``pytest.fixture`` is applied more than once to the same function a
``ValueError`` is raised. This buggy behavior would cause surprising problems
and if was working for a test suite it was mostly by accident. (`2334
<https://github.com/pytest-dev/pytest/issues/2334>`_)

- Support for Python 3.7's builtin ``breakpoint()`` method, see `Using the
builtin breakpoint function
<https://docs.pytest.org/en/latest/usage.htmlbreakpoint-builtin>`_ for
details. (`3180 <https://github.com/pytest-dev/pytest/issues/3180>`_)

- ``monkeypatch`` now supports a ``context()`` function which acts as a context
manager which undoes all patching done within the ``with`` block. (`3290
<https://github.com/pytest-dev/pytest/issues/3290>`_)

- The ``--pdb`` option now causes KeyboardInterrupt to enter the debugger,
instead of stopping the test session. On python 2.7, hitting CTRL+C again
exits the debugger. On python 3.2 and higher, use CTRL+D. (`3299
<https://github.com/pytest-dev/pytest/issues/3299>`_)

- pytest not longer changes the log level of the root logger when the
``log-level`` parameter has greater numeric value than that of the level of
the root logger, which makes it play better with custom logging configuration
in user code. (`3307 <https://github.com/pytest-dev/pytest/issues/3307>`_)


Bug Fixes
---------

- A rare race-condition which might result in corrupted ``.pyc`` files on
Windows has been hopefully solved. (`3008
<https://github.com/pytest-dev/pytest/issues/3008>`_)

- Also use iter_marker for discovering the marks applying for marker
expressions from the cli to avoid the bad data from the legacy mark storage.
(`3441 <https://github.com/pytest-dev/pytest/issues/3441>`_)

- When showing diffs of failed assertions where the contents contain only
whitespace, escape them using ``repr()`` first to make it easy to spot the
differences. (`3443 <https://github.com/pytest-dev/pytest/issues/3443>`_)


Improved Documentation
----------------------

- Change documentation copyright year to a range which auto-updates itself each
time it is published. (`3303
<https://github.com/pytest-dev/pytest/issues/3303>`_)


Trivial/Internal Changes
------------------------

- ``pytest`` now depends on the `python-atomicwrites
<https://github.com/untitaker/python-atomicwrites>`_ library. (`3008
<https://github.com/pytest-dev/pytest/issues/3008>`_)

- Update all pypi.python.org URLs to pypi.org. (`3431
<https://github.com/pytest-dev/pytest/issues/3431>`_)

- Detect `pytest_` prefixed hooks using the internal plugin manager since
``pluggy`` is deprecating the ``implprefix`` argument to ``PluginManager``.
(`3487 <https://github.com/pytest-dev/pytest/issues/3487>`_)

- Import ``Mapping`` and ``Sequence`` from ``_pytest.compat`` instead of
directly from ``collections`` in ``python_api.py::approx``. Add ``Mapping``
to ``_pytest.compat``, import it from ``collections`` on python 2, but from
``collections.abc`` on Python 3 to avoid a ``DeprecationWarning`` on Python
3.7 or newer. (`3497 <https://github.com/pytest-dev/pytest/issues/3497>`_)

3.5.1

=========================


Bug Fixes
---------

- Reset ``sys.last_type``, ``sys.last_value`` and ``sys.last_traceback`` before
each test executes. Those attributes are added by pytest during the test run
to aid debugging, but were never reset so they would create a leaking
reference to the last failing test's frame which in turn could never be
reclaimed by the garbage collector. (`2798
<https://github.com/pytest-dev/pytest/issues/2798>`_)

- ``pytest.raises`` now raises ``TypeError`` when receiving an unknown keyword
argument. (`3348 <https://github.com/pytest-dev/pytest/issues/3348>`_)

- ``pytest.raises`` now works with exception classes that look like iterables.
(`3372 <https://github.com/pytest-dev/pytest/issues/3372>`_)


Improved Documentation
----------------------

- Fix typo in ``caplog`` fixture documentation, which incorrectly identified
certain attributes as methods. (`3406
<https://github.com/pytest-dev/pytest/issues/3406>`_)


Trivial/Internal Changes
------------------------

- Added a more indicative error message when parametrizing a function whose
argument takes a default value. (`3221
<https://github.com/pytest-dev/pytest/issues/3221>`_)

- Remove internal ``_pytest.terminal.flatten`` function in favor of
``more_itertools.collapse``. (`3330
<https://github.com/pytest-dev/pytest/issues/3330>`_)

- Import some modules from ``collections.abc`` instead of ``collections`` as
the former modules trigger ``DeprecationWarning`` in Python 3.7. (`3339
<https://github.com/pytest-dev/pytest/issues/3339>`_)

- record_property is no longer experimental, removing the warnings was
forgotten. (`3360 <https://github.com/pytest-dev/pytest/issues/3360>`_)

- Mention in documentation and CLI help that fixtures with leading ``_`` are
printed by ``pytest --fixtures`` only if the ``-v`` option is added. (`3398
<https://github.com/pytest-dev/pytest/issues/3398>`_)

3.5.0

=========================

Deprecations and Removals
-------------------------

- ``record_xml_property`` fixture is now deprecated in favor of the more
generic ``record_property``. (`2770
<https://github.com/pytest-dev/pytest/issues/2770>`_)

- Defining ``pytest_plugins`` is now deprecated in non-top-level conftest.py
files, because they "leak" to the entire directory tree. (`3084
<https://github.com/pytest-dev/pytest/issues/3084>`_)


Features
--------

- New ``--show-capture`` command-line option that allows to specify how to
display captured output when tests fail: ``no``, ``stdout``, ``stderr``,
``log`` or ``all`` (the default). (`1478
<https://github.com/pytest-dev/pytest/issues/1478>`_)

- New ``--rootdir`` command-line option to override the rules for discovering
the root directory. See `customize
<https://docs.pytest.org/en/latest/customize.html>`_ in the documentation for
details. (`1642 <https://github.com/pytest-dev/pytest/issues/1642>`_)

- Fixtures are now instantiated based on their scopes, with higher-scoped
fixtures (such as ``session``) being instantiated first than lower-scoped
fixtures (such as ``function``). The relative order of fixtures of the same
scope is kept unchanged, based in their declaration order and their
dependencies. (`2405 <https://github.com/pytest-dev/pytest/issues/2405>`_)

- ``record_xml_property`` renamed to ``record_property`` and is now compatible
with xdist, markers and any reporter. ``record_xml_property`` name is now
deprecated. (`2770 <https://github.com/pytest-dev/pytest/issues/2770>`_)

- New ``--nf``, ``--new-first`` options: run new tests first followed by the
rest of the tests, in both cases tests are also sorted by the file modified
time, with more recent files coming first. (`3034
<https://github.com/pytest-dev/pytest/issues/3034>`_)

- New ``--last-failed-no-failures`` command-line option that allows to specify
the behavior of the cache plugin's --last-failed`` feature when no tests
failed in the last run (or no cache was found): ``none`` or ``all`` (the
default). (`3139 <https://github.com/pytest-dev/pytest/issues/3139>`_)

- New ``--doctest-continue-on-failure`` command-line option to enable doctests
to show multiple failures for each snippet, instead of stopping at the first
failure. (`3149 <https://github.com/pytest-dev/pytest/issues/3149>`_)

- Captured log messages are added to the ``<system-out>`` tag in the generated
junit xml file if the ``junit_logging`` ini option is set to ``system-out``.
If the value of this ini option is ``system-err``, the logs are written to
``<system-err>``. The default value for ``junit_logging`` is ``no``, meaning
captured logs are not written to the output file. (`3156
<https://github.com/pytest-dev/pytest/issues/3156>`_)

- Allow the logging plugin to handle ``pytest_runtest_logstart`` and
``pytest_runtest_logfinish`` hooks when live logs are enabled. (`3189
<https://github.com/pytest-dev/pytest/issues/3189>`_)

- Passing `--log-cli-level` in the command-line now automatically activates
live logging. (`3190 <https://github.com/pytest-dev/pytest/issues/3190>`_)

- Add command line option ``--deselect`` to allow deselection of individual
tests at collection time. (`3198
<https://github.com/pytest-dev/pytest/issues/3198>`_)

- Captured logs are printed before entering pdb. (`3204
<https://github.com/pytest-dev/pytest/issues/3204>`_)

- Deselected item count is now shown before tests are run, e.g. ``collected X
items / Y deselected``. (`3213
<https://github.com/pytest-dev/pytest/issues/3213>`_)

- The builtin module ``platform`` is now available for use in expressions in
``pytest.mark``. (`3236
<https://github.com/pytest-dev/pytest/issues/3236>`_)

- The *short test summary info* section now is displayed after tracebacks and
warnings in the terminal. (`3255
<https://github.com/pytest-dev/pytest/issues/3255>`_)

- New ``--verbosity`` flag to set verbosity level explicitly. (`3296
<https://github.com/pytest-dev/pytest/issues/3296>`_)

- ``pytest.approx`` now accepts comparing a numpy array with a scalar. (`3312
<https://github.com/pytest-dev/pytest/issues/3312>`_)


Bug Fixes
---------

- Suppress ``IOError`` when closing the temporary file used for capturing
streams in Python 2.7. (`2370
<https://github.com/pytest-dev/pytest/issues/2370>`_)

- Fixed ``clear()`` method on ``caplog`` fixture which cleared ``records``, but
not the ``text`` property. (`3297
<https://github.com/pytest-dev/pytest/issues/3297>`_)

- During test collection, when stdin is not allowed to be read, the
``DontReadFromStdin`` object still allow itself to be iterable and resolved
to an iterator without crashing. (`3314
<https://github.com/pytest-dev/pytest/issues/3314>`_)


Improved Documentation
----------------------

- Added a `reference <https://docs.pytest.org/en/latest/reference.html>`_ page
to the docs. (`1713 <https://github.com/pytest-dev/pytest/issues/1713>`_)


Trivial/Internal Changes
------------------------

- Change minimum requirement of ``attrs`` to ``17.4.0``. (`3228
<https://github.com/pytest-dev/pytest/issues/3228>`_)

- Renamed example directories so all tests pass when ran from the base
directory. (`3245 <https://github.com/pytest-dev/pytest/issues/3245>`_)

- Internal ``mark.py`` module has been turned into a package. (`3250
<https://github.com/pytest-dev/pytest/issues/3250>`_)

- ``pytest`` now depends on the `more-itertools
<https://github.com/erikrose/more-itertools>`_ package. (`3265
<https://github.com/pytest-dev/pytest/issues/3265>`_)

- Added warning when ``[pytest]`` section is used in a ``.cfg`` file passed
with ``-c`` (`3268 <https://github.com/pytest-dev/pytest/issues/3268>`_)

- ``nodeids`` can now be passed explicitly to ``FSCollector`` and ``Node``
constructors. (`3291 <https://github.com/pytest-dev/pytest/issues/3291>`_)

- Internal refactoring of ``FormattedExcinfo`` to use ``attrs`` facilities and
remove old support code for legacy Python versions. (`3292
<https://github.com/pytest-dev/pytest/issues/3292>`_)

- Refactoring to unify how verbosity is handled internally. (`3296
<https://github.com/pytest-dev/pytest/issues/3296>`_)

- Internal refactoring to better integrate with argparse. (`3304
<https://github.com/pytest-dev/pytest/issues/3304>`_)

- Fix a python example when calling a fixture in doc/en/usage.rst (`3308
<https://github.com/pytest-dev/pytest/issues/3308>`_)

3.4.2

=========================

Bug Fixes
---------

- Removed progress information when capture option is ``no``. (`3203
<https://github.com/pytest-dev/pytest/issues/3203>`_)

- Refactor check of bindir from ``exists`` to ``isdir``. (`3241
<https://github.com/pytest-dev/pytest/issues/3241>`_)

- Fix ``TypeError`` issue when using ``approx`` with a ``Decimal`` value.
(`3247 <https://github.com/pytest-dev/pytest/issues/3247>`_)

- Fix reference cycle generated when using the ``request`` fixture. (`3249
<https://github.com/pytest-dev/pytest/issues/3249>`_)

- ``[tool:pytest]`` sections in ``*.cfg`` files passed by the ``-c`` option are
now properly recognized. (`3260
<https://github.com/pytest-dev/pytest/issues/3260>`_)


Improved Documentation
----------------------

- Add logging plugin to plugins list. (`3209
<https://github.com/pytest-dev/pytest/issues/3209>`_)


Trivial/Internal Changes
------------------------

- Fix minor typo in fixture.rst (`3259
<https://github.com/pytest-dev/pytest/issues/3259>`_)

3.4.1

=========================

Bug Fixes
---------

- Move import of ``doctest.UnexpectedException`` to top-level to avoid possible
errors when using ``--pdb``. (`1810
<https://github.com/pytest-dev/pytest/issues/1810>`_)

- Added printing of captured stdout/stderr before entering pdb, and improved a
test which was giving false negatives about output capturing. (`3052
<https://github.com/pytest-dev/pytest/issues/3052>`_)

- Fix ordering of tests using parametrized fixtures which can lead to fixtures
being created more than necessary. (`3161
<https://github.com/pytest-dev/pytest/issues/3161>`_)

- Fix bug where logging happening at hooks outside of "test run" hooks would
cause an internal error. (`3184
<https://github.com/pytest-dev/pytest/issues/3184>`_)

- Detect arguments injected by ``unittest.mock.patch`` decorator correctly when
pypi ``mock.patch`` is installed and imported. (`3206
<https://github.com/pytest-dev/pytest/issues/3206>`_)

- Errors shown when a ``pytest.raises()`` with ``match=`` fails are now cleaner
on what happened: When no exception was raised, the "matching '...'" part got
removed as it falsely implies that an exception was raised but it didn't
match. When a wrong exception was raised, it's now thrown (like
``pytest.raised()`` without ``match=`` would) instead of complaining about
the unmatched text. (`3222
<https://github.com/pytest-dev/pytest/issues/3222>`_)

- Fixed output capture handling in doctests on macOS. (`985
<https://github.com/pytest-dev/pytest/issues/985>`_)


Improved Documentation
----------------------

- Add Sphinx parameter docs for ``match`` and ``message`` args to
``pytest.raises``. (`3202
<https://github.com/pytest-dev/pytest/issues/3202>`_)


Trivial/Internal Changes
------------------------

- pytest has changed the publication procedure and is now being published to
PyPI directly from Travis. (`3060
<https://github.com/pytest-dev/pytest/issues/3060>`_)

- Rename ``ParameterSet._for_parameterize()`` to ``_for_parametrize()`` in
order to comply with the naming convention. (`3166
<https://github.com/pytest-dev/pytest/issues/3166>`_)

- Skip failing pdb/doctest test on mac. (`985
<https://github.com/pytest-dev/pytest/issues/985>`_)
Links

@pyup-bot pyup-bot mentioned this pull request Jun 21, 2018
@coveralls
Copy link

Coverage Status

Coverage remained the same at 100.0% when pulling 6d6dcc5 on pyup-update-pytest-3.4.0-to-3.6.2 into b07575b on master.

1 similar comment
@coveralls
Copy link

coveralls commented Jun 21, 2018

Coverage Status

Coverage remained the same at 100.0% when pulling 6d6dcc5 on pyup-update-pytest-3.4.0-to-3.6.2 into b07575b on master.

@pyup-bot
Copy link
Collaborator Author

pyup-bot commented Jul 5, 2018

Closing this in favor of #124

@pyup-bot pyup-bot closed this Jul 5, 2018
@s-m-i-t-a s-m-i-t-a deleted the pyup-update-pytest-3.4.0-to-3.6.2 branch July 5, 2018 11:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants