[Pytest-commit] commit/pytest: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Sat Nov 2 07:04:39 CET 2013
2 new commits in pytest:
https://bitbucket.org/hpk42/pytest/commits/9909daf848ee/
Changeset: 9909daf848ee
User: hpk42
Date: 2013-10-25 16:50:05
Summary: add german pytest talk (pyconde2013)
Affected #: 1 file
diff -r 8e65b5b17d12942193881ddcb9a244bc470a6fff -r 9909daf848eef27f575020ecc92e4250c3061f54 doc/en/talks.txt
--- a/doc/en/talks.txt
+++ b/doc/en/talks.txt
@@ -10,7 +10,10 @@
.. _`tutorial1 repository`: http://bitbucket.org/hpk42/pytest-tutorial1/
.. _`pycon 2010 tutorial PDF`: http://bitbucket.org/hpk42/pytest-tutorial1/raw/tip/pytest-basic.pdf
-Basic usage and funcargs:
+Basic usage and fixtures:
+
+- `pytest feature and release highlights (GERMAN, October 2013)
+ <http://pyvideo.org/video/2429/pytest-feature-and-new-release-highlights>`_
- `pytest introduction from Brian Okken (January 2013)
<http://pythontesting.net/framework/pytest-introduction/>`_
https://bitbucket.org/hpk42/pytest/commits/257206079bab/
Changeset: 257206079bab
User: hpk42
Date: 2013-11-02 07:04:26
Summary: merge, add changelog entry
Affected #: 3 files
diff -r 9909daf848eef27f575020ecc92e4250c3061f54 -r 257206079babf818a2819a44f5cf30c64d572287 CHANGELOG
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,6 +1,8 @@
-Changes between 2.4.2 and 2.4.3
+Unreleased
-----------------------------------
+- allow nested parametrize-value markers, thanks James Lan for the PR.
+
- fix unicode handling with new monkeypatch.setattr(import_path, value)
API. Thanks Rob Dennis. Fixes issue371.
@@ -30,6 +32,7 @@
arg is an lambda and thus the example will work. Thanks Alex Gaynor
for bringing it up.
+
Changes between 2.4.1 and 2.4.2
-----------------------------------
diff -r 9909daf848eef27f575020ecc92e4250c3061f54 -r 257206079babf818a2819a44f5cf30c64d572287 _pytest/python.py
--- a/_pytest/python.py
+++ b/_pytest/python.py
@@ -693,16 +693,17 @@
to set a dynamic scope using test context or configuration.
"""
- # individual parametrized argument sets can be wrapped in a
- # marker in which case we unwrap the values and apply the mark
+ # individual parametrized argument sets can be wrapped in a series
+ # of markers in which case we unwrap the values and apply the mark
# at Function init
newkeywords = {}
unwrapped_argvalues = []
for i, argval in enumerate(argvalues):
- if isinstance(argval, MarkDecorator):
+ while isinstance(argval, MarkDecorator):
newmark = MarkDecorator(argval.markname,
argval.args[:-1], argval.kwargs)
- newkeywords[i] = {newmark.markname: newmark}
+ newmarks = newkeywords.setdefault(i, {})
+ newmarks[newmark.markname] = newmark
argval = argval.args[-1]
unwrapped_argvalues.append(argval)
argvalues = unwrapped_argvalues
diff -r 9909daf848eef27f575020ecc92e4250c3061f54 -r 257206079babf818a2819a44f5cf30c64d572287 testing/python/collect.py
--- a/testing/python/collect.py
+++ b/testing/python/collect.py
@@ -355,6 +355,21 @@
rec = testdir.inline_run()
rec.assertoutcome(passed=2)
+ def test_parametrize_with_mark(selfself, testdir):
+ items = testdir.getitems("""
+ import pytest
+ @pytest.mark.foo
+ @pytest.mark.parametrize('arg', [
+ 1,
+ pytest.mark.bar(pytest.mark.baz(2))
+ ])
+ def test_function(arg):
+ pass
+ """)
+ keywords = [item.keywords for item in items]
+ assert 'foo' in keywords[0] and 'bar' not in keywords[0] and 'baz' not in keywords[0]
+ assert 'foo' in keywords[1] and 'bar' in keywords[1] and 'baz' in keywords[1]
+
def test_function_equality_with_callspec(self, testdir, tmpdir):
items = testdir.getitems("""
import pytest
Repository URL: https://bitbucket.org/hpk42/pytest/
--
This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.
More information about the pytest-commit
mailing list