Skip to content

Commit

Permalink
merge master to features
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jun 1, 2016
2 parents 8c1be62 + f423f08 commit b5bd4d9
Show file tree
Hide file tree
Showing 28 changed files with 262 additions and 119 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ include/
*.class
*.orig
*~
.hypothesis/

.eggs/

Expand Down
23 changes: 20 additions & 3 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -79,14 +79,24 @@
.. _#372: https://github.com/pytest-dev/pytest/issues/372
.. _#1544: https://github.com/pytest-dev/pytest/issues/1544

2.9.2.dev1
==========

**Bug Fixes**

* When receiving identical test ids in parametrize we generate unique test ids.

* Fix win32 path issue when puttinging custom config file with absolute path
2.9.2
=====

**Bug Fixes**

* fix `#510`_: skip tests where one parameterize dimension was empty
thanks Alex Stapleton for the Report and `@RonnyPfannschmidt`_ for the PR

* Fix Xfail does not work with condition keyword argument.
Thanks `@astraw38`_ for reporting the issue (`#1496`_) and `@tomviner`_
for PR the (`#1524`_).

* Fix win32 path issue when puttinging custom config file with absolute path
in ``pytest.main("-c your_absolute_path")``.

* Fix maximum recursion depth detection when raised error class is not aware
Expand All @@ -100,10 +110,17 @@
* Minor improvements and fixes to the documentation.
Thanks `@omarkohl`_ for the PR.

* Fix ``--fixtures`` to show all fixture definitions as opposed to just
one per fixture name.
Thanks to `@hackebrot`_ for the PR.

.. _#510: https://github.com/pytest-dev/pytest/issues/510
.. _#1506: https://github.com/pytest-dev/pytest/pull/1506
.. _#1496: https://github.com/pytest-dev/pytest/issue/1496
.. _#1524: https://github.com/pytest-dev/pytest/issue/1524

.. _@prusse-martin: https://github.com/prusse-martin
.. _@astraw38: https://github.com/astraw38


2.9.1
Expand Down
4 changes: 2 additions & 2 deletions HOWTORELEASE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ Note: this assumes you have already registered on pypi.
8. Build the docs, you need a virtualenv with py and sphinx
installed::

cd doc/en
cd doc/en
make html

Commit any changes before tagging the release.
Expand Down Expand Up @@ -71,7 +71,7 @@ Note: this assumes you have already registered on pypi.

11. Publish to pypi::

devpi push pytest-VERSION pypi:NAME
devpi push pytest==VERSION pypi:NAME

where NAME is the name of pypi.python.org as configured in your ``~/.pypirc``
file `for devpi <http://doc.devpi.net/latest/quickstart-releaseprocess.html?highlight=pypirc#devpi-push-releasing-to-an-external-index>`_.
Expand Down
32 changes: 15 additions & 17 deletions _pytest/python.py
Original file line number Diff line number Diff line change
Expand Up @@ -894,8 +894,6 @@ def setmulti(self, valtypes, argnames, valset, id, keywords, scopenum,
getattr(self, valtype_for_arg)[arg] = val
self.indices[arg] = param_index
self._arg2scopenum[arg] = scopenum
if val is _notexists:
self._emptyparamspecified = True
self._idlist.append(id)
self.keywords.update(keywords)

Expand Down Expand Up @@ -1014,6 +1012,15 @@ def parametrize(self, argnames, argvalues, indirect=False, ids=None,
argvalues = [(val,) for val in argvalues]
if not argvalues:
argvalues = [(_notexists,) * len(argnames)]
# we passed a empty list to parameterize, skip that test
#
fs, lineno = getfslineno(self.function)
newmark = pytest.mark.skip(
reason="got empty parameter set %r, function %s at %s:%d" % (
argnames, self.function.__name__, fs, lineno))
newmarks = newkeywords.setdefault(0, {})
newmarks[newmark.markname] = newmark


if scope is None:
scope = "function"
Expand Down Expand Up @@ -1206,12 +1213,12 @@ def _showfixtures_main(config, session):
assert fixturedefs is not None
if not fixturedefs:
continue
fixturedef = fixturedefs[-1]
loc = getlocation(fixturedef.func, curdir)
available.append((len(fixturedef.baseid),
fixturedef.func.__module__,
curdir.bestrelpath(loc),
fixturedef.argname, fixturedef))
for fixturedef in fixturedefs:
loc = getlocation(fixturedef.func, curdir)
available.append((len(fixturedef.baseid),
fixturedef.func.__module__,
curdir.bestrelpath(loc),
fixturedef.argname, fixturedef))

available.sort()
currentmodule = None
Expand Down Expand Up @@ -1703,15 +1710,6 @@ def runtest(self):
self.ihook.pytest_pyfunc_call(pyfuncitem=self)

def setup(self):
# check if parametrization happend with an empty list
try:
self.callspec._emptyparamspecified
except AttributeError:
pass
else:
fs, lineno = self._getfslineno()
pytest.skip("got empty parameter set, function %s at %s:%d" %(
self.function.__name__, fs, lineno))
super(Function, self).setup()
fillfixtures(self)

Expand Down
4 changes: 3 additions & 1 deletion _pytest/skipping.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def _istrue(self):
return self.result
if self.holder:
d = self._getglobals()
if self.holder.args:
if self.holder.args or 'condition' in self.holder.kwargs:
self.result = False
# "holder" might be a MarkInfo or a MarkDecorator; only
# MarkInfo keeps track of all parameters it received in an
Expand All @@ -130,6 +130,8 @@ def _istrue(self):
else:
arglist = [(self.holder.args, self.holder.kwargs)]
for args, kwargs in arglist:
if 'condition' in kwargs:
args = (kwargs['condition'],)
for expr in args:
self.expr = expr
if isinstance(expr, py.builtin._basestring):
Expand Down
3 changes: 2 additions & 1 deletion doc/en/announce/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ Release announcements


sprint2016
release-2.9.1
release-2.9.1
release-2.9.0
release-2.8.7
release-2.8.6
Expand Down Expand Up @@ -45,4 +47,3 @@ Release announcements
release-2.0.2
release-2.0.1
release-2.0.0

73 changes: 73 additions & 0 deletions doc/en/announce/release-2.9.2.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
pytest-2.9.2
============

pytest is a mature Python testing tool with more than a 1100 tests
against itself, passing on many different interpreters and platforms.

See below for the changes and see docs at:

http://pytest.org

As usual, you can upgrade from pypi via::

pip install -U pytest

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

Adam Chainz
Benjamin Dopplinger
Bruno Oliveira
Florian Bruhin
John Towler
Martin Prusse
Meng Jue
MengJueM
Omar Kohl
Quentin Pradet
Ronny Pfannschmidt
Thomas Güttler
TomV
Tyler Goodlet


Happy testing,
The py.test Development Team


2.9.2 (compared to 2.9.1)
---------------------------

**Bug Fixes**

* fix `#510`_: skip tests where one parameterize dimension was empty
thanks Alex Stapleton for the Report and `@RonnyPfannschmidt`_ for the PR

* Fix Xfail does not work with condition keyword argument.
Thanks `@astraw38`_ for reporting the issue (`#1496`_) and `@tomviner`_
for PR the (`#1524`_).

* Fix win32 path issue when puttinging custom config file with absolute path
in ``pytest.main("-c your_absolute_path")``.

* Fix maximum recursion depth detection when raised error class is not aware
of unicode/encoded bytes.
Thanks `@prusse-martin`_ for the PR (`#1506`_).

* Fix ``pytest.mark.skip`` mark when used in strict mode.
Thanks `@pquentin`_ for the PR and `@RonnyPfannschmidt`_ for
showing how to fix the bug.

* Minor improvements and fixes to the documentation.
Thanks `@omarkohl`_ for the PR.

* Fix ``--fixtures`` to show all fixture definitions as opposed to just
one per fixture name.
Thanks to `@hackebrot`_ for the PR.

.. _#510: https://github.com/pytest-dev/pytest/issues/510
.. _#1506: https://github.com/pytest-dev/pytest/pull/1506
.. _#1496: https://github.com/pytest-dev/pytest/issue/1496
.. _#1524: https://github.com/pytest-dev/pytest/issue/1524

.. _@prusse-martin: https://github.com/prusse-martin
.. _@astraw38: https://github.com/astraw38
6 changes: 3 additions & 3 deletions doc/en/assert.rst
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ you will see the return value of the function call::

$ py.test test_assert1.py
======= test session starts ========
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR, inifile:
collected 1 items
Expand Down Expand Up @@ -161,7 +161,7 @@ if you run this module::

$ py.test test_assert2.py
======= test session starts ========
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR, inifile:
collected 1 items
Expand All @@ -174,7 +174,7 @@ if you run this module::
set1 = set("1308")
set2 = set("8035")
> assert set1 == set2
E assert set(['0', '1', '3', '8']) == set(['0', '3', '5', '8'])
E assert {'0', '1', '3', '8'} == {'0', '3', '5', '8'}
E Extra items in the left set:
E '1'
E Extra items in the right set:
Expand Down
6 changes: 3 additions & 3 deletions doc/en/cache.rst
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ If you then run it with ``--lf``::

$ py.test --lf
======= test session starts ========
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
run-last-failure: rerun last 2 failures
rootdir: $REGENDOC_TMPDIR, inifile:
collected 50 items
Expand Down Expand Up @@ -121,7 +121,7 @@ of ``FF`` and dots)::

$ py.test --ff
======= test session starts ========
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
run-last-failure: rerun last 2 failures first
rootdir: $REGENDOC_TMPDIR, inifile:
collected 50 items
Expand Down Expand Up @@ -226,7 +226,7 @@ You can always peek at the content of the cache using the

$ py.test --cache-clear
======= test session starts ========
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR, inifile:
collected 1 items
Expand Down
2 changes: 1 addition & 1 deletion doc/en/capture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ of the failing function and hide the other one::

$ py.test
======= test session starts ========
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR, inifile:
collected 2 items
Expand Down
2 changes: 1 addition & 1 deletion doc/en/doctest.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ then you can just invoke ``py.test`` without command line options::

$ py.test
======= test session starts ========
platform linux -- Python 3.4.0, pytest-2.9.1, py-1.4.31, pluggy-0.3.1
platform linux -- Python 3.5.1, pytest-2.9.2, py-1.4.31, pluggy-0.3.1
rootdir: $REGENDOC_TMPDIR, inifile: pytest.ini
collected 1 items
Expand Down
Loading

0 comments on commit b5bd4d9

Please sign in to comment.