Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
48 commits
Select commit Hold shift + click to select a range
bc22472
turn config into package
RonnyPfannschmidt Jun 5, 2018
026cd36
make builtin plugins a list
RonnyPfannschmidt Jun 5, 2018
c9df77c
move argument parser to own file
RonnyPfannschmidt Jun 5, 2018
1459cbe
put config path finding and exceptions into own modules
RonnyPfannschmidt Jun 5, 2018
464117b
fix imports in tests
RonnyPfannschmidt Jun 5, 2018
1aba123
fix doc build
RonnyPfannschmidt Jun 11, 2018
5221a14
Failing test case for #3583
jwodder Jun 14, 2018
d382f3e
[#3583] Fix encoding error with `print` statements in doctests
jwodder Jun 14, 2018
b285078
Merge pull request #3535 from RonnyPfannschmidt/config-split
asottile Jun 15, 2018
acb8f23
Fix 2 DeprecationWarnings about invalid escape seq
hynek Jun 16, 2018
4dc7b4a
Merge pull request #3589 from hynek/master
RonnyPfannschmidt Jun 16, 2018
9408291
Fixing parens typo in fixture.rst
alexbarbato Jun 16, 2018
561db95
Add changelog file.
alexbarbato Jun 16, 2018
a93ad1f
Merge pull request #3590 from alexbarbato/3525_typo_fixture_docs
asottile Jun 16, 2018
2925f30
Merge pull request #3584 from jwodder/fix-3583
nicoddemus Jun 18, 2018
93e55ad
Remove unused attribute and parameter in CallSpec2
nicoddemus Jun 19, 2018
8e9f1d2
Use --show-diff-on-failure for pre-commit CI invocation
asottile Jun 19, 2018
85be8bd
Merge pull request #3599 from pytest-dev/asottile-patch-1
nicoddemus Jun 19, 2018
af5d41f
add build-system section to pyproject.toml
RonnyPfannschmidt Jun 19, 2018
19ba243
Merge pull request #3600 from RonnyPfannschmidt/pyproject-compliance
nicoddemus Jun 19, 2018
617a5fc
Preparing release version 3.6.2
nicoddemus Jun 20, 2018
46aa18d
Lint regendoc changes
nicoddemus Jun 20, 2018
130100b
Fix reference to py36-freeze in travis and appveyor
nicoddemus Jun 20, 2018
5b26178
Merge pull request #3602 from nicoddemus/release-3.6.2
nicoddemus Jun 20, 2018
e86fe38
Merge pull request #3598 from nicoddemus/small-callspec2-cleanup
RonnyPfannschmidt Jun 20, 2018
b7b9c54
Merge pull request #3603 from nicoddemus/fix-freeze-job
RonnyPfannschmidt Jun 21, 2018
1ac1ee6
Fixed text description above skipif's example
AdamEr8 Jun 21, 2018
8b4c59e
Silence usage of `reduce` warning in python 2
asottile Jun 21, 2018
630428c
Merge pull request #3609 from asottile/remove_warning_py2_functools_r…
asottile Jun 21, 2018
5e56d77
Create prnum.trivial.rst
AdamEr8 Jun 22, 2018
40839b5
Rename prnum.trivial.rst to 3611.trivial.rst
AdamEr8 Jun 22, 2018
f883628
Changelog mistake
AdamEr8 Jun 22, 2018
4970f6d
Improve reason in skipif example
nicoddemus Jun 22, 2018
8cc2107
Improve changelog and change it to doc
nicoddemus Jun 22, 2018
1d55c49
Fix `ImportWarning` triggered by explicit relative imports
asottile Jun 23, 2018
17985b8
Remove warning filter as well
asottile Jun 23, 2018
22a2734
Merge pull request #3611 from AdamEr8/doc-fix-skipif
asottile Jun 23, 2018
deff54a
Try import mock, but on python 3.3+ can use also stdlib unittest.mock
mimi1vx Jun 22, 2018
50a0d4f
Merge pull request #3613 from asottile/module_spec_warnings
nicoddemus Jun 23, 2018
42b3125
Merge pull request #3612 from mimi1vx/patch-1
RonnyPfannschmidt Jun 24, 2018
0030ceb
Bug fix #3593 - approx method in a single element of numpy array
marcelotrevisani Jun 24, 2018
1d5316a
Update pypi.python.org URLs to pypi.org
jdufresne Jun 26, 2018
738b715
Merge pull request #3619 from jdufresne/pypi
nicoddemus Jun 26, 2018
8133d19
Merge pull request #3615 from marcelotrevisani/bug-3593-pytest-approx
RonnyPfannschmidt Jun 26, 2018
cbaa7dd
Upgrade pre-commit hooks except pyupgrade
asottile Jun 26, 2018
f940967
Fix test offset after black moved code
asottile Jun 25, 2018
f93995e
Merge pull request #3614 from asottile/upgrade_hooks
RonnyPfannschmidt Jun 26, 2018
89e0a3e
merge from master to features
RonnyPfannschmidt Jun 26, 2018
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
exclude: doc/en/example/py2py3/test_py2.py
repos:
- repo: https://github.com/ambv/black
rev: 18.4a4
rev: 18.6b4
hooks:
- id: black
args: [--safe, --quiet]
language_version: python3.6
- repo: https://github.com/asottile/blacken-docs
rev: v0.1.1
rev: v0.2.0
hooks:
- id: blacken-docs
additional_dependencies: [black==18.5b1]
additional_dependencies: [black==18.6b4]
language_version: python3.6
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v1.2.3
rev: v1.3.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
Expand Down
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ jobs:
python: 'pypy-5.4'
- env: TOXENV=py35
python: '3.5'
- env: TOXENV=py35-freeze
python: '3.5'
- env: TOXENV=py36-freeze
python: '3.6'
- env: TOXENV=py37
python: 'nightly'

Expand Down
2 changes: 2 additions & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,7 @@ Maik Figura
Mandeep Bhutani
Manuel Krebber
Marc Schlaich
Marcelo Duarte Trevisani
Marcin Bachry
Mark Abramowitz
Markus Unterwaditzer
Expand Down Expand Up @@ -157,6 +158,7 @@ Oleg Sushchenko
Oliver Bestwalter
Omar Kohl
Omer Hadari
Ondřej Súkup
Patrick Hayes
Paweł Adamczak
Pedro Algarvio
Expand Down
46 changes: 46 additions & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,52 @@

.. towncrier release notes start

Pytest 3.6.2 (2018-06-20)
=========================

Bug Fixes
---------

- Fix regression in ``Node.add_marker`` by extracting the mark object of a
``MarkDecorator``. (`#3555
<https://github.com/pytest-dev/pytest/issues/3555>`_)

- Warnings without ``location`` were reported as ``None``. This is corrected to
now report ``<undetermined location>``. (`#3563
<https://github.com/pytest-dev/pytest/issues/3563>`_)

- Continue to call finalizers in the stack when a finalizer in a former scope
raises an exception. (`#3569
<https://github.com/pytest-dev/pytest/issues/3569>`_)

- Fix encoding error with `print` statements in doctests (`#3583
<https://github.com/pytest-dev/pytest/issues/3583>`_)


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

- Add documentation for the ``--strict`` flag. (`#3549
<https://github.com/pytest-dev/pytest/issues/3549>`_)


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

- Update old quotation style to parens in fixture.rst documentation. (`#3525
<https://github.com/pytest-dev/pytest/issues/3525>`_)

- Improve display of hint about ``--fulltrace`` with ``KeyboardInterrupt``.
(`#3545 <https://github.com/pytest-dev/pytest/issues/3545>`_)

- pytest's testsuite is no longer runnable through ``python setup.py test`` --
instead invoke ``pytest`` or ``tox`` directly. (`#3552
<https://github.com/pytest-dev/pytest/issues/3552>`_)

- Fix typo in documentation (`#3567
<https://github.com/pytest-dev/pytest/issues/3567>`_)


Pytest 3.6.1 (2018-06-05)
=========================

Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ environment:
- TOXENV: "py36-pluggymaster"
- TOXENV: "py27-nobyte"
- TOXENV: "doctesting"
- TOXENV: "py35-freeze"
- TOXENV: "py36-freeze"
- TOXENV: "docs"

install:
Expand Down
1 change: 1 addition & 0 deletions changelog/3061.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix ``ImportWarning`` triggered by explicit relative imports in assertion-rewritten package modules.
1 change: 0 additions & 1 deletion changelog/3545.trivial.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3549.doc.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3552.trivial.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3555.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3563.bugfix.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3567.trivial.rst

This file was deleted.

1 change: 0 additions & 1 deletion changelog/3569.bugfix.rst

This file was deleted.

5 changes: 5 additions & 0 deletions changelog/3593.bugfix.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
If the user pass as a expected value a numpy array created like
numpy.array(5); it will creates an array with one element without shape,
when used with approx it will raise an error for the `repr`
'TypeError: iteration over a 0-d array'. With this PR pytest will iterate
properly in the numpy array even with 0 dimension.
1 change: 1 addition & 0 deletions changelog/3598.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Internal refactoring: removed unused ``CallSpec2tox ._globalid_args`` attribute and ``metafunc`` parameter from ``CallSpec2.copy()``.
1 change: 1 addition & 0 deletions changelog/3609.trivial.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Silence usage of ``reduce`` warning in python 2
1 change: 1 addition & 0 deletions changelog/3611.doc.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
The description above the example for ``@pytest.mark.skipif`` now better matches the code.
1 change: 1 addition & 0 deletions doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2


release-3.6.2
release-3.6.1
release-3.6.0
release-3.5.1
Expand Down
2 changes: 1 addition & 1 deletion doc/en/announce/release-2.4.0.rst
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ a full list of details. A few feature highlights:
called if the corresponding setup method succeeded.

- integrate tab-completion on command line options if you
have `argcomplete <http://pypi.python.org/pypi/argcomplete>`_
have `argcomplete <https://pypi.org/project/argcomplete/>`_
configured.

- allow boolean expression directly with skipif/xfail
Expand Down
29 changes: 29 additions & 0 deletions doc/en/announce/release-3.6.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
pytest-3.6.2
=======================================

pytest 3.6.2 has just been released to PyPI.

This is a bug-fix release, being a drop-in replacement. To upgrade::

pip install --upgrade pytest

The full changelog is available at http://doc.pytest.org/en/latest/changelog.html.

Thanks to all who contributed to this release, among them:

* Alan Velasco
* Alex Barbato
* Anthony Sottile
* Bartosz Cierocki
* Bruno Oliveira
* Daniel Hahler
* Guoqiang Zhang
* Hynek Schlawack
* John T. Wodder II
* Michael Käufl
* Ronny Pfannschmidt
* Samuel Dion-Girardeau


Happy testing,
The pytest Development Team
17 changes: 0 additions & 17 deletions doc/en/example/assertion/failure_demo.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,7 @@ def pytest_generate_tests(metafunc):


class TestFailing(object):

def test_simple(self):

def f():
return 42

Expand All @@ -40,15 +38,13 @@ def test_simple_multiline(self):
otherfunc_multi(42, 6 * 9)

def test_not(self):

def f():
return 42

assert not f()


class TestSpecialisedExplanations(object):

def test_eq_text(self):
assert "spam" == "eggs"

Expand Down Expand Up @@ -106,7 +102,6 @@ def test_not_in_text_single_long_term(self):


def test_attribute():

class Foo(object):
b = 1

Expand All @@ -115,17 +110,14 @@ class Foo(object):


def test_attribute_instance():

class Foo(object):
b = 1

assert Foo().b == 2


def test_attribute_failure():

class Foo(object):

def _get_b(self):
raise Exception("Failed to get attrib")

Expand All @@ -136,7 +128,6 @@ def _get_b(self):


def test_attribute_multiple():

class Foo(object):
b = 1

Expand All @@ -151,7 +142,6 @@ def globf(x):


class TestRaises(object):

def test_raises(self):
s = "qwe" # NOQA
raises(TypeError, "int(s)")
Expand Down Expand Up @@ -193,9 +183,7 @@ def test_dynamic_compile_shows_nicely():


class TestMoreErrors(object):

def test_complex_error(self):

def f():
return 44

Expand All @@ -218,7 +206,6 @@ def test_startswith(self):
assert s.startswith(g)

def test_startswith_nested(self):

def f():
return "123"

Expand Down Expand Up @@ -246,17 +233,14 @@ def test_try_finally(self):


class TestCustomAssertMsg(object):

def test_single_line(self):

class A(object):
a = 1

b = 2
assert A.a == b, "A.a appears not to be b"

def test_multiline(self):

class A(object):
a = 1

Expand All @@ -266,7 +250,6 @@ class A(object):
), "A.a appears not to be b\n" "or does not appear to be b\none of those"

def test_custom_repr(self):

class JSON(object):
a = 1

Expand Down
2 changes: 1 addition & 1 deletion doc/en/example/assertion/test_failures.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import py

failure_demo = py.path.local(__file__).dirpath("failure_demo.py")
pytest_plugins = "pytester",
pytest_plugins = ("pytester",)


def test_failure_demo_fails_properly(testdir):
Expand Down
1 change: 0 additions & 1 deletion doc/en/example/assertion/test_setup_flow_example.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ def setup_module(module):


class TestStateFullThing(object):

def setup_class(cls):
cls.classcount += 1

Expand Down
1 change: 0 additions & 1 deletion doc/en/example/costlysetup/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ def setup(request):


class CostlySetup(object):

def __init__(self):
import time

Expand Down
1 change: 0 additions & 1 deletion doc/en/example/multipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ def python2(request, python1):


class Python(object):

def __init__(self, version, picklefile):
self.pythonpath = py.path.local.sysfind(version)
if not self.pythonpath:
Expand Down
2 changes: 0 additions & 2 deletions doc/en/example/nonpython/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ def pytest_collect_file(parent, path):


class YamlFile(pytest.File):

def collect(self):
import yaml # we need a yaml parser, e.g. PyYAML

Expand All @@ -19,7 +18,6 @@ def collect(self):


class YamlItem(pytest.Item):

def __init__(self, name, parent, spec):
super(YamlItem, self).__init__(name, parent)
self.spec = spec
Expand Down
1 change: 0 additions & 1 deletion doc/en/example/py2py3/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@


class DummyCollector(pytest.collect.File):

def collect(self):
return []

Expand Down
1 change: 0 additions & 1 deletion doc/en/example/pythoncollection.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ def test_function():


class TestClass(object):

def test_method(self):
pass

Expand Down
2 changes: 1 addition & 1 deletion doc/en/example/reportingdemo.rst
Original file line number Diff line number Diff line change
Expand Up @@ -625,7 +625,7 @@ get on the terminal - we are working on that)::

failure_demo.py:278: AssertionError
============================= warnings summary =============================
None
<undetermined location>
Metafunc.addcall is deprecated and scheduled to be removed in pytest 4.0.
Please use Metafunc.parametrize instead.

Expand Down
4 changes: 2 additions & 2 deletions doc/en/fixture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ This makes use of the automatic caching mechanisms of pytest.
Another good approach is by adding the data files in the ``tests`` folder.
There are also community plugins available to help managing this aspect of
testing, e.g. `pytest-datadir <https://github.com/gabrielcnr/pytest-datadir>`__
and `pytest-datafiles <https://pypi.python.org/pypi/pytest-datafiles>`__.
and `pytest-datafiles <https://pypi.org/project/pytest-datafiles/>`__.

.. _smtpshared:

Expand All @@ -165,7 +165,7 @@ Scope: sharing a fixture instance across tests in a class, module or session

Fixtures requiring network access depend on connectivity and are
usually time-expensive to create. Extending the previous example, we
can add a ``scope='module'`` parameter to the
can add a ``scope="module"`` parameter to the
:py:func:`@pytest.fixture <_pytest.python.fixture>` invocation
to cause the decorated ``smtp`` fixture function to only be invoked once
per test *module* (the default is to invoke once per test *function*).
Expand Down
Loading