[Python-modules-commits] [pytest] 01/05: Import pytest_3.0.3.orig.tar.gz
Sebastian Ramacher
sramacher at moszumanska.debian.org
Sat Oct 1 10:17:00 UTC 2016
This is an automated email from the git hooks/post-receive script.
sramacher pushed a commit to branch master
in repository pytest.
commit 4258035b4ba1fcc9844bc8f259c4a04e49b47001
Author: Sebastian Ramacher <sramacher at debian.org>
Date: Sat Oct 1 10:52:55 2016 +0200
Import pytest_3.0.3.orig.tar.gz
---
AUTHORS | 3 ++
CHANGELOG.rst | 44 +++++++++++++++++++++-
HOWTORELEASE.rst | 12 +++---
PKG-INFO | 2 +-
_pytest/__init__.py | 2 +-
_pytest/_code/code.py | 3 ++
_pytest/_code/source.py | 11 +++---
_pytest/assertion/util.py | 2 +-
_pytest/cacheprovider.py | 0
_pytest/config.py | 27 +++++++------
_pytest/fixtures.py | 24 +++++++++++-
_pytest/mark.py | 2 +-
_pytest/python.py | 18 +++++----
_pytest/vendored_packages/README.md | 2 +-
.../pluggy-0.3.1.dist-info/RECORD | 8 ----
.../pluggy-0.3.1.dist-info/metadata.json | 1 -
.../pluggy-0.3.1.dist-info/pbr.json | 1 -
.../DESCRIPTION.rst | 1 +
.../pluggy-0.4.0.dist-info/INSTALLER | 1 +
.../pluggy-0.4.0.dist-info/LICENSE.txt | 22 +++++++++++
.../METADATA | 5 ++-
.../pluggy-0.4.0.dist-info/RECORD | 9 +++++
.../WHEEL | 2 +-
.../pluggy-0.4.0.dist-info/metadata.json | 1 +
.../top_level.txt | 0
_pytest/vendored_packages/pluggy.py | 41 ++++++++++++++++----
doc/en/Makefile | 19 +---------
doc/en/_getdoctarget.py | 16 --------
doc/en/_templates/links.html | 2 +-
doc/en/announce/index.rst | 1 +
doc/en/announce/release-3.0.2.rst | 10 ++---
.../{release-3.0.2.rst => release-3.0.3.rst} | 21 ++++++-----
doc/en/assert.rst | 4 +-
doc/en/cache.rst | 6 +--
doc/en/capture.rst | 2 +-
doc/en/conf.py | 7 +---
doc/en/doctest.rst | 2 +-
doc/en/example/markers.rst | 28 +++++++-------
doc/en/example/nonpython.rst | 6 +--
doc/en/example/parametrize.rst | 12 +++---
doc/en/example/pythoncollection.rst | 6 +--
doc/en/example/reportingdemo.rst | 2 +-
doc/en/example/simple.rst | 22 +++++------
doc/en/fixture.rst | 10 ++---
doc/en/getting-started.rst | 4 +-
doc/en/index.rst | 2 +-
doc/en/monkeypatch.rst | 1 +
doc/en/parametrize.rst | 7 +---
doc/en/skipping.rst | 40 +++++++++++++++++++-
doc/en/tmpdir.rst | 2 +-
doc/en/unittest.rst | 8 +++-
pytest.egg-info/PKG-INFO | 2 +-
pytest.egg-info/SOURCES.txt | 17 +++++----
pytest.egg-info/entry_points.txt | 2 +-
pytest.egg-info/top_level.txt | 2 +-
testing/python/fixture.py | 16 ++++++++
testing/python/metafunc.py | 16 ++++++++
testing/test_assertion.py | 30 +++++++++++++--
testing/test_cache.py | 0
tox.ini | 11 +++---
60 files changed, 384 insertions(+), 196 deletions(-)
diff --git a/AUTHORS b/AUTHORS
index c74aa4a..d8c431d 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -78,6 +78,7 @@ Kale Kundert
Katarzyna Jachim
Kevin Cox
Lee Kamentsky
+Lev Maximov
Lukas Bednar
Maciek Fijalkowski
Maho
@@ -106,6 +107,7 @@ Punyashloka Biswal
Quentin Pradet
Ralf Schmitt
Raphael Pierzina
+Raquel Alegre
Roberto Polli
Romain Dorgueil
Roman Bolshakov
@@ -125,6 +127,7 @@ Ted Xiao
Thomas Grainger
Tom Viner
Trevor Bekolay
+Tyler Goodlet
Vasily Kuznetsov
Wouter van Ackooy
Xuecong Liao
diff --git a/CHANGELOG.rst b/CHANGELOG.rst
index 867ae6e..4f6be4f 100644
--- a/CHANGELOG.rst
+++ b/CHANGELOG.rst
@@ -1,3 +1,41 @@
+3.0.3
+=====
+
+* The ``ids`` argument to ``parametrize`` again accepts ``unicode`` strings
+ in Python 2 (`#1905`_).
+ Thanks `@philpep`_ for the report and `@nicoddemus`_ for the PR.
+
+* Assertions are now being rewritten for plugins in development mode
+ (``pip install -e``) (`#1934`_).
+ Thanks `@nicoddemus`_ for the PR.
+
+* Fix pkg_resources import error in Jython projects (`#1853`).
+ Thanks `@raquel-ucl`_ for the PR.
+
+* Got rid of ``AttributeError: 'Module' object has no attribute '_obj'`` exception
+ in Python 3 (`#1944`_).
+ Thanks `@axil`_ for the PR.
+
+* Explain a bad scope value passed to ``@fixture`` declarations or
+ a ``MetaFunc.parametrize()`` call. Thanks `@tgoodlet`_ for the PR.
+
+* This version includes ``pluggy-0.4.0``, which correctly handles
+ ``VersionConflict`` errors in plugins (`#704`_).
+ Thanks `@nicoddemus`_ for the PR.
+
+
+.. _ at philpep: https://github.com/philpep
+.. _ at raquel-ucl: https://github.com/raquel-ucl
+.. _ at axil: https://github.com/axil
+.. _ at tgoodlet: https://github.com/tgoodlet
+
+.. _#1905: https://github.com/pytest-dev/pytest/issues/1905
+.. _#1934: https://github.com/pytest-dev/pytest/issues/1934
+.. _#1944: https://github.com/pytest-dev/pytest/issues/1944
+.. _#704: https://github.com/pytest-dev/pytest/issues/704
+
+
+
3.0.2
=====
@@ -75,7 +113,11 @@ time or change existing behaviors in order to make them less surprising/more use
* Reinterpretation mode has now been removed. Only plain and rewrite
mode are available, consequently the ``--assert=reinterp`` option is
- no longer available. Thanks `@flub`_ for the PR.
+ no longer available. This also means files imported from plugins or
+ ``conftest.py`` will not benefit from improved assertions by
+ default, you should use ``pytest.register_assert_rewrite()`` to
+ explicitly turn on assertion rewriting for those files. Thanks
+ `@flub`_ for the PR.
* The following deprecated commandline options were removed:
diff --git a/HOWTORELEASE.rst b/HOWTORELEASE.rst
index e6f1973..372ecf7 100644
--- a/HOWTORELEASE.rst
+++ b/HOWTORELEASE.rst
@@ -54,8 +54,8 @@ Note: this assumes you have already registered on pypi.
11. Send release announcement to mailing lists:
- pytest-dev at python.org
- - testing-in-python at lists.idyll.org
- python-announce-list at python.org
+ - testing-in-python at lists.idyll.org (only for minor/major releases)
And announce the release on Twitter, making sure to add the hashtag ``#pytest``.
@@ -64,19 +64,19 @@ Note: this assumes you have already registered on pypi.
a. **patch release (2.8.3)**:
1. Checkout ``master``.
- 2. Update version number in ``_pytest/__init__.py`` to ``"2.8.4.dev"``.
- 3. Create a new section in ``CHANGELOG.rst`` titled ``2.8.4.dev`` and add a few bullet points as placeholders for new entries.
+ 2. Update version number in ``_pytest/__init__.py`` to ``"2.8.4.dev0"``.
+ 3. Create a new section in ``CHANGELOG.rst`` titled ``2.8.4.dev0`` and add a few bullet points as placeholders for new entries.
4. Commit and push.
b. **minor release (2.9.0)**:
1. Merge ``features`` into ``master``.
2. Checkout ``master``.
- 3. Follow the same steps for a **patch release** above, using the next patch release: ``2.9.1.dev``.
+ 3. Follow the same steps for a **patch release** above, using the next patch release: ``2.9.1.dev0``.
4. Commit ``master``.
5. Checkout ``features`` and merge with ``master`` (should be a fast-forward at this point).
- 6. Update version number in ``_pytest/__init__.py`` to the next minor release: ``"2.10.0.dev"``.
- 7. Create a new section in ``CHANGELOG.rst`` titled ``2.10.0.dev``, above ``2.9.1.dev``, and add a few bullet points as placeholders for new entries.
+ 6. Update version number in ``_pytest/__init__.py`` to the next minor release: ``"2.10.0.dev0"``.
+ 7. Create a new section in ``CHANGELOG.rst`` titled ``2.10.0.dev0``, above ``2.9.1.dev0``, and add a few bullet points as placeholders for new entries.
8. Commit ``features``.
9. Push ``master`` and ``features``.
diff --git a/PKG-INFO b/PKG-INFO
index 651d580..b8b5ae8 100644
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
Metadata-Version: 1.1
Name: pytest
-Version: 3.0.2
+Version: 3.0.3
Summary: pytest: simple powerful testing with Python
Home-page: http://pytest.org
Author: Holger Krekel, Bruno Oliveira, Ronny Pfannschmidt, Floris Bruynooghe, Brianna Laugher, Florian Bruhin and others
diff --git a/_pytest/__init__.py b/_pytest/__init__.py
index 757e560..4c3823e 100644
--- a/_pytest/__init__.py
+++ b/_pytest/__init__.py
@@ -1,2 +1,2 @@
#
-__version__ = '3.0.2'
+__version__ = '3.0.3'
diff --git a/_pytest/_code/code.py b/_pytest/_code/code.py
index 9a6d326..30e1294 100644
--- a/_pytest/_code/code.py
+++ b/_pytest/_code/code.py
@@ -12,6 +12,7 @@ if sys.version_info[0] >= 3:
else:
from ._py2traceback import format_exception_only
+
class Code(object):
""" wrapper around Python code objects """
def __init__(self, rawcode):
@@ -28,6 +29,8 @@ class Code(object):
def __eq__(self, other):
return self.raw == other.raw
+ __hash__ = None
+
def __ne__(self, other):
return not self == other
diff --git a/_pytest/_code/source.py b/_pytest/_code/source.py
index a1521f8..846e3cc 100644
--- a/_pytest/_code/source.py
+++ b/_pytest/_code/source.py
@@ -52,22 +52,21 @@ class Source(object):
return str(self) == other
return False
+ __hash__ = None
+
def __getitem__(self, key):
if isinstance(key, int):
return self.lines[key]
else:
if key.step not in (None, 1):
raise IndexError("cannot slice a Source with a step")
- return self.__getslice__(key.start, key.stop)
+ newsource = Source()
+ newsource.lines = self.lines[key.start:key.stop]
+ return newsource
def __len__(self):
return len(self.lines)
- def __getslice__(self, start, end):
- newsource = Source()
- newsource.lines = self.lines[start:end]
- return newsource
-
def strip(self):
""" return new source object with trailing
and leading blank lines removed.
diff --git a/_pytest/assertion/util.py b/_pytest/assertion/util.py
index 2481cf3..4a0a4e4 100644
--- a/_pytest/assertion/util.py
+++ b/_pytest/assertion/util.py
@@ -105,7 +105,7 @@ except NameError:
def assertrepr_compare(config, op, left, right):
"""Return specialised explanations for some operators/operands"""
width = 80 - 15 - len(op) - 2 # 15 chars indentation, 1 space around op
- left_repr = py.io.saferepr(left, maxsize=int(width/2))
+ left_repr = py.io.saferepr(left, maxsize=int(width//2))
right_repr = py.io.saferepr(right, maxsize=width-len(left_repr))
summary = u('%s %s %s') % (ecu(left_repr), op, ecu(right_repr))
diff --git a/_pytest/cacheprovider.py b/_pytest/cacheprovider.py
old mode 100755
new mode 100644
diff --git a/_pytest/config.py b/_pytest/config.py
index 5b4654a..661a851 100644
--- a/_pytest/config.py
+++ b/_pytest/config.py
@@ -5,7 +5,6 @@ import traceback
import types
import warnings
-import pkg_resources
import py
# DON't import pytest here because it causes import cycle troubles
import sys, os
@@ -952,18 +951,24 @@ class Config(object):
except SystemError:
mode = 'plain'
else:
+ import pkg_resources
self.pluginmanager.rewrite_hook = hook
for entrypoint in pkg_resources.iter_entry_points('pytest11'):
- for entry in entrypoint.dist._get_metadata('RECORD'):
- fn = entry.split(',')[0]
- is_simple_module = os.sep not in fn and fn.endswith('.py')
- is_package = fn.count(os.sep) == 1 and fn.endswith('__init__.py')
- if is_simple_module:
- module_name, ext = os.path.splitext(fn)
- hook.mark_rewrite(module_name)
- elif is_package:
- package_name = os.path.dirname(fn)
- hook.mark_rewrite(package_name)
+ # 'RECORD' available for plugins installed normally (pip install)
+ # 'SOURCES.txt' available for plugins installed in dev mode (pip install -e)
+ # for installed plugins 'SOURCES.txt' returns an empty list, and vice-versa
+ # so it shouldn't be an issue
+ for metadata in ('RECORD', 'SOURCES.txt'):
+ for entry in entrypoint.dist._get_metadata(metadata):
+ fn = entry.split(',')[0]
+ is_simple_module = os.sep not in fn and fn.endswith('.py')
+ is_package = fn.count(os.sep) == 1 and fn.endswith('__init__.py')
+ if is_simple_module:
+ module_name, ext = os.path.splitext(fn)
+ hook.mark_rewrite(module_name)
+ elif is_package:
+ package_name = os.path.dirname(fn)
+ hook.mark_rewrite(package_name)
self._warn_about_missing_assertion(mode)
def _warn_about_missing_assertion(self, mode):
diff --git a/_pytest/fixtures.py b/_pytest/fixtures.py
index cf3e9dd..3f08b7c 100644
--- a/_pytest/fixtures.py
+++ b/_pytest/fixtures.py
@@ -599,12 +599,29 @@ class ScopeMismatchError(Exception):
which has a lower scope (e.g. a Session one calls a function one)
"""
+
scopes = "session module class function".split()
scopenum_function = scopes.index("function")
+
+
def scopemismatch(currentscope, newscope):
return scopes.index(newscope) > scopes.index(currentscope)
+def scope2index(scope, descr, where=None):
+ """Look up the index of ``scope`` and raise a descriptive value error
+ if not defined.
+ """
+ try:
+ return scopes.index(scope)
+ except ValueError:
+ raise ValueError(
+ "{0} {1}has an unsupported scope value '{2}'".format(
+ descr, 'from {0} '.format(where) if where else '',
+ scope)
+ )
+
+
class FixtureLookupError(LookupError):
""" could not return a requested Fixture (missing or invalid). """
def __init__(self, argname, request, msg=None):
@@ -703,6 +720,7 @@ def call_fixture_func(fixturefunc, request, kwargs):
res = fixturefunc(**kwargs)
return res
+
class FixtureDef:
""" A container for a factory definition. """
def __init__(self, fixturemanager, baseid, argname, func, scope, params,
@@ -713,7 +731,11 @@ class FixtureDef:
self.func = func
self.argname = argname
self.scope = scope
- self.scopenum = scopes.index(scope or "function")
+ self.scopenum = scope2index(
+ scope or "function",
+ descr='fixture {0}'.format(func.__name__),
+ where=baseid
+ )
self.params = params
startindex = unittest and 1 or None
self.argnames = getfuncargnames(func, startindex=startindex)
diff --git a/_pytest/mark.py b/_pytest/mark.py
index 40c998c..640c4e6 100644
--- a/_pytest/mark.py
+++ b/_pytest/mark.py
@@ -19,7 +19,7 @@ def pytest_addoption(parser):
help="only run tests which match the given substring expression. "
"An expression is a python evaluatable expression "
"where all names are substring-matched against test names "
- "and their parent classes. Example: -k 'test_method or test "
+ "and their parent classes. Example: -k 'test_method or test_"
"other' matches all test functions and classes whose name "
"contains 'test_method' or 'test_other'. "
"Additionally keywords are matched to classes and functions "
diff --git a/_pytest/python.py b/_pytest/python.py
index 2ab1de6..eacea99 100644
--- a/_pytest/python.py
+++ b/_pytest/python.py
@@ -205,11 +205,10 @@ class PyobjContext(object):
class PyobjMixin(PyobjContext):
def obj():
def fget(self):
- try:
- return self._obj
- except AttributeError:
+ obj = getattr(self, '_obj', None)
+ if obj is None:
self._obj = obj = self._getobj()
- return obj
+ return obj
def fset(self, value):
self._obj = value
return property(fget, fset, None, "underlying python object")
@@ -771,7 +770,7 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
It will also override any fixture-function defined scope, allowing
to set a dynamic scope using test context or configuration.
"""
- from _pytest.fixtures import scopes
+ from _pytest.fixtures import scope2index
from _pytest.mark import extract_argvalue
from py.io import saferepr
@@ -800,7 +799,8 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
if scope is None:
scope = _find_parametrized_scope(argnames, self._arg2fixturedefs, indirect)
- scopenum = scopes.index(scope)
+ scopenum = scope2index(
+ scope, descr='call to {0}'.format(self.parametrize))
valtypes = {}
for arg in argnames:
if arg not in self.fixturenames:
@@ -832,7 +832,7 @@ class Metafunc(fixtures.FuncargnamesCompatAttr):
raise ValueError('%d tests specified with %d ids' %(
len(argvalues), len(ids)))
for id_value in ids:
- if id_value is not None and not isinstance(id_value, str):
+ if id_value is not None and not isinstance(id_value, py.builtin._basestring):
msg = 'ids must be list of strings, found: %s (type: %s)'
raise ValueError(msg % (saferepr(id_value), type(id_value).__name__))
ids = idmaker(argnames, argvalues, idfn, ids, self.config)
@@ -1357,6 +1357,8 @@ class approx(object):
return False
return all(a == x for a, x in zip(actual, self.expected))
+ __hash__ = None
+
def __ne__(self, actual):
return not (actual == self)
@@ -1436,6 +1438,8 @@ class ApproxNonIterable(object):
# Return true if the two numbers are within the tolerance.
return abs(self.expected - actual) <= self.tolerance
+ __hash__ = None
+
def __ne__(self, actual):
return not (actual == self)
diff --git a/_pytest/vendored_packages/README.md b/_pytest/vendored_packages/README.md
index eab7c71..b5fe6fe 100644
--- a/_pytest/vendored_packages/README.md
+++ b/_pytest/vendored_packages/README.md
@@ -10,4 +10,4 @@ $ pip install -U pluggy==<version> --no-compile --target=_pytest/vendored_packag
```
And commit the modified files. The `pluggy-<version>.dist-info` directory
-created by `pip` should be ignored.
+created by `pip` should be added as well.
diff --git a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/RECORD b/_pytest/vendored_packages/pluggy-0.3.1.dist-info/RECORD
deleted file mode 100644
index 9626673..0000000
--- a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/RECORD
+++ /dev/null
@@ -1,8 +0,0 @@
-pluggy.py,sha256=v_RfWzyW6DPU1cJu_EFoL_OHq3t13qloVdR6UaMCXQA,29862
-pluggy-0.3.1.dist-info/top_level.txt,sha256=xKSCRhai-v9MckvMuWqNz16c1tbsmOggoMSwTgcpYHE,7
-pluggy-0.3.1.dist-info/pbr.json,sha256=xX3s6__wOcAyF-AZJX1sdZyW6PUXT-FkfBlM69EEUCg,47
-pluggy-0.3.1.dist-info/RECORD,,
-pluggy-0.3.1.dist-info/metadata.json,sha256=nLKltOT78dMV-00uXD6Aeemp4xNsz2q59j6ORSDeLjw,1027
-pluggy-0.3.1.dist-info/METADATA,sha256=1b85Ho2u4iK30M099k7axMzcDDhLcIMb-A82JUJZnSo,1334
-pluggy-0.3.1.dist-info/WHEEL,sha256=AvR0WeTpDaxT645bl5FQxUK6NPsTls2ttpcGJg3j1Xg,110
-pluggy-0.3.1.dist-info/DESCRIPTION.rst,sha256=P5Akh1EdIBR6CeqtV2P8ZwpGSpZiTKPw0NyS7jEiD-g,306
diff --git a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/metadata.json b/_pytest/vendored_packages/pluggy-0.3.1.dist-info/metadata.json
deleted file mode 100644
index 426a3a7..0000000
--- a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/metadata.json
+++ /dev/null
@@ -1 +0,0 @@
-{"license": "MIT license", "name": "pluggy", "metadata_version": "2.0", "generator": "bdist_wheel (0.24.0)", "summary": "plugin and hook calling mechanisms for python", "platform": "unix", "version": "0.3.1", "extensions": {"python.details": {"document_names": {"description": "DESCRIPTION.rst"}, "contacts": [{"role": "author", "email": "holger at merlinux.eu", "name": "Holger Krekel"}]}}, "classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI [...]
\ No newline at end of file
diff --git a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/pbr.json b/_pytest/vendored_packages/pluggy-0.3.1.dist-info/pbr.json
deleted file mode 100644
index d6b7986..0000000
--- a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/pbr.json
+++ /dev/null
@@ -1 +0,0 @@
-{"is_release": false, "git_version": "7d4c9cd"}
\ No newline at end of file
diff --git a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/DESCRIPTION.rst b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/DESCRIPTION.rst
similarity index 99%
rename from _pytest/vendored_packages/pluggy-0.3.1.dist-info/DESCRIPTION.rst
rename to _pytest/vendored_packages/pluggy-0.4.0.dist-info/DESCRIPTION.rst
index aa3bbf8..da0e7a6 100644
--- a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/DESCRIPTION.rst
+++ b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/DESCRIPTION.rst
@@ -1,3 +1,4 @@
+
Plugin registration and hook calling for Python
===============================================
diff --git a/_pytest/vendored_packages/pluggy-0.4.0.dist-info/INSTALLER b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/INSTALLER
new file mode 100644
index 0000000..a1b589e
--- /dev/null
+++ b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/INSTALLER
@@ -0,0 +1 @@
+pip
diff --git a/_pytest/vendored_packages/pluggy-0.4.0.dist-info/LICENSE.txt b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/LICENSE.txt
new file mode 100644
index 0000000..121017d
--- /dev/null
+++ b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/LICENSE.txt
@@ -0,0 +1,22 @@
+The MIT License (MIT)
+
+Copyright (c) 2015 holger krekel (rather uses bitbucket/hpk42)
+
+Permission is hereby granted, free of charge, to any person obtaining a copy
+of this software and associated documentation files (the "Software"), to deal
+in the Software without restriction, including without limitation the rights
+to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
+copies of the Software, and to permit persons to whom the Software is
+furnished to do so, subject to the following conditions:
+
+The above copyright notice and this permission notice shall be included in all
+copies or substantial portions of the Software.
+
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
+AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
+OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
+SOFTWARE.
+
diff --git a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/METADATA b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/METADATA
similarity index 95%
rename from _pytest/vendored_packages/pluggy-0.3.1.dist-info/METADATA
rename to _pytest/vendored_packages/pluggy-0.4.0.dist-info/METADATA
index ec81f0a..bd88517 100644
--- a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/METADATA
+++ b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/METADATA
@@ -1,8 +1,8 @@
Metadata-Version: 2.0
Name: pluggy
-Version: 0.3.1
+Version: 0.4.0
Summary: plugin and hook calling mechanisms for python
-Home-page: UNKNOWN
+Home-page: https://github.com/pytest-dev/pluggy
Author: Holger Krekel
Author-email: holger at merlinux.eu
License: MIT license
@@ -27,6 +27,7 @@ Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
+
Plugin registration and hook calling for Python
===============================================
diff --git a/_pytest/vendored_packages/pluggy-0.4.0.dist-info/RECORD b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/RECORD
new file mode 100644
index 0000000..3003a3b
--- /dev/null
+++ b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/RECORD
@@ -0,0 +1,9 @@
+pluggy.py,sha256=u0oG9cv-oLOkNvEBlwnnu8pp1AyxpoERgUO00S3rvpQ,31543
+pluggy-0.4.0.dist-info/DESCRIPTION.rst,sha256=ltvjkFd40LW_xShthp6RRVM6OB_uACYDFR3kTpKw7o4,307
+pluggy-0.4.0.dist-info/LICENSE.txt,sha256=ruwhUOyV1HgE9F35JVL9BCZ9vMSALx369I4xq9rhpkM,1134
+pluggy-0.4.0.dist-info/METADATA,sha256=pe2hbsqKFaLHC6wAQPpFPn0KlpcPfLBe_BnS4O70bfk,1364
+pluggy-0.4.0.dist-info/RECORD,,
+pluggy-0.4.0.dist-info/WHEEL,sha256=9Z5Xm-eel1bTS7e6ogYiKz0zmPEqDwIypurdHN1hR40,116
+pluggy-0.4.0.dist-info/metadata.json,sha256=T3go5L2qOa_-H-HpCZi3EoVKb8sZ3R-fOssbkWo2nvM,1119
+pluggy-0.4.0.dist-info/top_level.txt,sha256=xKSCRhai-v9MckvMuWqNz16c1tbsmOggoMSwTgcpYHE,7
+pluggy-0.4.0.dist-info/INSTALLER,sha256=zuuue4knoyJ-UwPPXg8fezS7VCrXJQrAP7zeNuwvFQg,4
diff --git a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/WHEEL b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/WHEEL
similarity index 70%
rename from _pytest/vendored_packages/pluggy-0.3.1.dist-info/WHEEL
rename to _pytest/vendored_packages/pluggy-0.4.0.dist-info/WHEEL
index 9dff69d..8b6dd1b 100644
--- a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/WHEEL
+++ b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/WHEEL
@@ -1,5 +1,5 @@
Wheel-Version: 1.0
-Generator: bdist_wheel (0.24.0)
+Generator: bdist_wheel (0.29.0)
Root-Is-Purelib: true
Tag: py2-none-any
Tag: py3-none-any
diff --git a/_pytest/vendored_packages/pluggy-0.4.0.dist-info/metadata.json b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/metadata.json
new file mode 100644
index 0000000..cde22af
--- /dev/null
+++ b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/metadata.json
@@ -0,0 +1 @@
+{"classifiers": ["Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: POSIX", "Operating System :: Microsoft :: Windows", "Operating System :: MacOS :: MacOS X", "Topic :: Software Development :: Testing", "Topic :: Software Development :: Libraries", "Topic :: Utilities", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Langu [...]
\ No newline at end of file
diff --git a/_pytest/vendored_packages/pluggy-0.3.1.dist-info/top_level.txt b/_pytest/vendored_packages/pluggy-0.4.0.dist-info/top_level.txt
similarity index 100%
rename from _pytest/vendored_packages/pluggy-0.3.1.dist-info/top_level.txt
rename to _pytest/vendored_packages/pluggy-0.4.0.dist-info/top_level.txt
diff --git a/_pytest/vendored_packages/pluggy.py b/_pytest/vendored_packages/pluggy.py
index 2f848b2..9c13932 100644
--- a/_pytest/vendored_packages/pluggy.py
+++ b/_pytest/vendored_packages/pluggy.py
@@ -67,8 +67,9 @@ Pluggy currently consists of functionality for:
import sys
import inspect
-__version__ = '0.3.1'
-__all__ = ["PluginManager", "PluginValidationError",
+__version__ = '0.4.0'
+
+__all__ = ["PluginManager", "PluginValidationError", "HookCallError",
"HookspecMarker", "HookimplMarker"]
_py3 = sys.version_info > (3, 0)
@@ -308,7 +309,7 @@ class PluginManager(object):
""" Core Pluginmanager class which manages registration
of plugin objects and 1:N hook calling.
- You can register new hooks by calling ``addhooks(module_or_class)``.
+ You can register new hooks by calling ``add_hookspec(module_or_class)``.
You can register plugin objects (which contain hooks) by calling
``register(plugin)``. The Pluginmanager is initialized with a
prefix that is searched for in the names of the dict of registered
@@ -374,7 +375,10 @@ class PluginManager(object):
def parse_hookimpl_opts(self, plugin, name):
method = getattr(plugin, name)
- res = getattr(method, self.project_name + "_impl", None)
+ try:
+ res = getattr(method, self.project_name + "_impl", None)
+ except Exception:
+ res = {}
if res is not None and not isinstance(res, dict):
# false positive
res = None
@@ -455,6 +459,10 @@ class PluginManager(object):
""" Return a plugin or None for the given name. """
return self._name2plugin.get(name)
+ def has_plugin(self, name):
+ """ Return True if a plugin with the given name is registered. """
+ return self.get_plugin(name) is not None
+
def get_name(self, plugin):
""" Return name for registered plugin or None if not registered. """
for name, val in self._name2plugin.items():
@@ -492,7 +500,8 @@ class PluginManager(object):
def load_setuptools_entrypoints(self, entrypoint_name):
""" Load modules from querying the specified setuptools entrypoint name.
Return the number of loaded plugins. """
- from pkg_resources import iter_entry_points, DistributionNotFound
+ from pkg_resources import (iter_entry_points, DistributionNotFound,
+ VersionConflict)
for ep in iter_entry_points(entrypoint_name):
# is the plugin registered or blocked?
if self.get_plugin(ep.name) or self.is_blocked(ep.name):
@@ -501,6 +510,9 @@ class PluginManager(object):
plugin = ep.load()
except DistributionNotFound:
continue
+ except VersionConflict as e:
+ raise PluginValidationError(
+ "Plugin %r could not be loaded: %s!" % (ep.name, e))
self.register(plugin, name=ep.name)
self._plugin_distinfo.append((plugin, ep.dist))
return len(self._plugin_distinfo)
@@ -573,7 +585,7 @@ class _MultiCall:
# XXX note that the __multicall__ argument is supported only
# for pytest compatibility reasons. It was never officially
- # supported there and is explicitly deprecated since 2.8
+ # supported there and is explicitely deprecated since 2.8
# so we can remove it soon, allowing to avoid the below recursion
# in execute() and simplify/speed up the execute loop.
@@ -590,7 +602,13 @@ class _MultiCall:
while self.hook_impls:
hook_impl = self.hook_impls.pop()
- args = [all_kwargs[argname] for argname in hook_impl.argnames]
+ try:
+ args = [all_kwargs[argname] for argname in hook_impl.argnames]
+ except KeyError:
+ for argname in hook_impl.argnames:
+ if argname not in all_kwargs:
+ raise HookCallError(
+ "hook call must provide argument %r" % (argname,))
if hook_impl.hookwrapper:
return _wrapped_call(hook_impl.function(*args), self.execute)
res = hook_impl.function(*args)
@@ -629,7 +647,10 @@ def varnames(func, startindex=None):
startindex = 1
else:
if not inspect.isfunction(func) and not inspect.ismethod(func):
- func = getattr(func, '__call__', func)
+ try:
+ func = getattr(func, '__call__', func)
+ except Exception:
+ return ()
if startindex is None:
startindex = int(inspect.ismethod(func))
@@ -763,6 +784,10 @@ class PluginValidationError(Exception):
""" plugin failed validation. """
+class HookCallError(Exception):
+ """ Hook was called wrongly. """
+
+
if hasattr(inspect, 'signature'):
def _formatdef(func):
return "%s%s" % (
diff --git a/doc/en/Makefile b/doc/en/Makefile
index 8621f77..5499c40 100644
--- a/doc/en/Makefile
+++ b/doc/en/Makefile
@@ -19,10 +19,9 @@ REGENDOC_ARGS := \
--normalize "@/tmp/pytest-of-.*/pytest-\d+ at PYTEST_TMPDIR@" \
-
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest
-
+
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@@ -36,22 +35,6 @@ help:
clean:
-rm -rf $(BUILDDIR)/*
-SITETARGET=$(shell ./_getdoctarget.py)
-
-showtarget:
- @echo $(SITETARGET)
-
-install: html
- # for access talk to someone with login rights to
- # pytest-dev at pytest.org to add your ssh key
- rsync -avz _build/html/ pytest-dev at pytest.org:pytest.org/$(SITETARGET)
-
-installpdf: latexpdf
- @scp $(BUILDDIR)/latex/pytest.pdf pytest-dev at pytest.org:pytest.org/$(SITETARGET)
-
-installall: clean install installpdf
- @echo "done"
-
regen:
PYTHONDONTWRITEBYTECODE=1 COLUMNS=76 regendoc --update *.rst */*.rst ${REGENDOC_ARGS}
diff --git a/doc/en/_getdoctarget.py b/doc/en/_getdoctarget.py
deleted file mode 100755
index 20e487b..0000000
--- a/doc/en/_getdoctarget.py
+++ /dev/null
@@ -1,16 +0,0 @@
-#!/usr/bin/env python
-
-import py
-
-def get_version_string():
- fn = py.path.local(__file__).join("..", "..", "..",
- "_pytest", "__init__.py")
- for line in fn.readlines():
- if "version" in line and not line.strip().startswith('#'):
- return eval(line.split("=")[-1])
-
-def get_minor_version_string():
- return ".".join(get_version_string().split(".")[:2])
-
-if __name__ == "__main__":
- print (get_minor_version_string())
diff --git a/doc/en/_templates/links.html b/doc/en/_templates/links.html
index 56486a7..d855a01 100644
--- a/doc/en/_templates/links.html
+++ b/doc/en/_templates/links.html
@@ -6,6 +6,6 @@
<li><a href="https://github.com/pytest-dev/pytest/">pytest @ GitHub</a></li>
<li><a href="http://plugincompat.herokuapp.com/">3rd party plugins</a></li>
<li><a href="https://github.com/pytest-dev/pytest/issues">Issue Tracker</a></li>
- <li><a href="http://pytest.org/latest/pytest.pdf">PDF Documentation</a>
+ <li><a href="https://media.readthedocs.org/pdf/pytest/latest/pytest.pdf">PDF Documentation</a>
</ul>
diff --git a/doc/en/announce/index.rst b/doc/en/announce/index.rst
index 90e6fcb..9cb4527 100644
--- a/doc/en/announce/index.rst
+++ b/doc/en/announce/index.rst
@@ -6,6 +6,7 @@ Release announcements
:maxdepth: 2
+ release-3.0.3
release-3.0.2
release-3.0.1
release-3.0.0
diff --git a/doc/en/announce/release-3.0.2.rst b/doc/en/announce/release-3.0.2.rst
index 631f14f..9d1c05f 100644
--- a/doc/en/announce/release-3.0.2.rst
+++ b/doc/en/announce/release-3.0.2.rst
@@ -12,15 +12,13 @@ The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:
-* Adam Chainz
-* Andrew Svetlov
+* Ahn Ki-Wook
* Bruno Oliveira
-* Daniel Hahler
-* Dmitry Dygalo
* Florian Bruhin
-* Marcin Bachry
+* Jordan Guymon
+* Raphael Pierzina
* Ronny Pfannschmidt
-* matthiasha
+* mbyt
Happy testing,
The pytest Development Team
diff --git a/doc/en/announce/release-3.0.2.rst b/doc/en/announce/release-3.0.3.rst
similarity index 50%
copy from doc/en/announce/release-3.0.2.rst
copy to doc/en/announce/release-3.0.3.rst
index 631f14f..f001721 100644
--- a/doc/en/announce/release-3.0.2.rst
+++ b/doc/en/announce/release-3.0.3.rst
@@ -1,10 +1,10 @@
-pytest-3.0.2
+pytest-3.0.3
============
-pytest 3.0.2 has just been released to PyPI.
+pytest 3.0.3 has just been released to PyPI.
-This release fixes some regressions and bugs reported in version 3.0.1, being a
-drop-in replacement. To upgrade::
+This release fixes some regressions and bugs reported in the last version,
+being a drop-in replacement. To upgrade::
pip install --upgrade pytest
@@ -12,15 +12,16 @@ The changelog is available at http://doc.pytest.org/en/latest/changelog.html.
Thanks to all who contributed to this release, among them:
-* Adam Chainz
-* Andrew Svetlov
* Bruno Oliveira
-* Daniel Hahler
-* Dmitry Dygalo
* Florian Bruhin
-* Marcin Bachry
+* Floris Bruynooghe
+* Huayi Zhang
+* Lev Maximov
+* Raquel Alegre
* Ronny Pfannschmidt
-* matthiasha
+* Roy Williams
+* Tyler Goodlet
+* mbyt
Happy testing,
The pytest Development Team
diff --git a/doc/en/assert.rst b/doc/en/assert.rst
index 9a283b6..59d810c 100644
--- a/doc/en/assert.rst
+++ b/doc/en/assert.rst
@@ -26,7 +26,7 @@ you will see the return value of the function call::
$ pytest test_assert1.py
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: $REGENDOC_TMPDIR, inifile:
collected 1 items
@@ -170,7 +170,7 @@ if you run this module::
$ pytest test_assert2.py
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: $REGENDOC_TMPDIR, inifile:
collected 1 items
diff --git a/doc/en/cache.rst b/doc/en/cache.rst
index 5435d43..d94020f 100644
--- a/doc/en/cache.rst
+++ b/doc/en/cache.rst
@@ -80,7 +80,7 @@ If you then run it with ``--lf``::
$ pytest --lf
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
run-last-failure: rerun last 2 failures
rootdir: $REGENDOC_TMPDIR, inifile:
collected 50 items
@@ -122,7 +122,7 @@ of ``FF`` and dots)::
$ pytest --ff
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
run-last-failure: rerun last 2 failures first
rootdir: $REGENDOC_TMPDIR, inifile:
collected 50 items
@@ -227,7 +227,7 @@ You can always peek at the content of the cache using the
$ py.test --cache-show
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: $REGENDOC_TMPDIR, inifile:
cachedir: $REGENDOC_TMPDIR/.cache
------------------------------- cache values -------------------------------
diff --git a/doc/en/capture.rst b/doc/en/capture.rst
index f816628..afec55f 100644
--- a/doc/en/capture.rst
+++ b/doc/en/capture.rst
@@ -64,7 +64,7 @@ of the failing function and hide the other one::
$ pytest
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: $REGENDOC_TMPDIR, inifile:
collected 2 items
diff --git a/doc/en/conf.py b/doc/en/conf.py
index 1c15c17..f3b8d7d 100644
--- a/doc/en/conf.py
+++ b/doc/en/conf.py
@@ -19,11 +19,8 @@
# The short X.Y version.
import os, sys
-sys.path.insert(0, os.path.dirname(__file__))
-import _getdoctarget
-
-version = _getdoctarget.get_minor_version_string()
-release = _getdoctarget.get_version_string()
+from _pytest import __version__ as version
+release = ".".join(version.split(".")[:2])
# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
diff --git a/doc/en/doctest.rst b/doc/en/doctest.rst
index 198fb18..1cdae8a 100644
--- a/doc/en/doctest.rst
+++ b/doc/en/doctest.rst
@@ -49,7 +49,7 @@ then you can just invoke ``pytest`` without command line options::
$ pytest
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
collected 1 items
diff --git a/doc/en/example/markers.rst b/doc/en/example/markers.rst
index 414deb8..f0c9b0e 100644
--- a/doc/en/example/markers.rst
+++ b/doc/en/example/markers.rst
@@ -31,7 +31,7 @@ You can then restrict a test run to only run tests marked with ``webtest``::
$ pytest -v -m webtest
======= test session starts ========
- platform linux -- Python 3.5.2, pytest-3.0.2, py-1.4.31, pluggy-0.3.1 -- $PYTHON_PREFIX/bin/python3.5
+ platform linux -- Python 3.5.2, pytest-3.0.3, py-1.4.31, pluggy-0.4.0 -- $PYTHON_PREFIX/bin/python3.5
cachedir: .cache
rootdir: $REGENDOC_TMPDIR, inifile:
collecting ... collected 4 items
@@ -45,7 +45,7 @@ Or the inverse, running all tests except the webtest ones::
$ pytest -v -m "not webtest"
======= test session starts ========
... 810 lines suppressed ...
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/pytest.git
More information about the Python-modules-commits
mailing list