3 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/847d2afe11ef/ Changeset: 847d2afe11ef Branch: parametrize-fails-when-values-are User: bubenkoff Date: 2013-09-06 22:42:54 Summary: initial Affected #: 0 files
https://bitbucket.org/hpk42/pytest/commits/b3da592fbc92/ Changeset: b3da592fbc92 Branch: parametrize-fails-when-values-are User: bubenkoff Date: 2013-09-07 02:30:09 Summary: parametrize fails when values are unhashable - tests Affected #: 2 files diff -r 847d2afe11efe401500985ac99994009095404c2 -r b3da592fbc92a9fd0afb7019320f13f5dc1823f1 testing/python/collect.py --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -329,6 +329,24 @@ reprec = testdir.inline_run() reprec.assertoutcome(passed=1) + def test_parametrize_with_non_hashable_values(self, testdir): + """Test parametrization with non-hashable values.""" + testdir.makepyfile(""" + archival_mapping = { + '1.0': {'tag': '1.0'}, + '1.2.2a1': {'tag': 'release-1.2.2a1'}, + } + + import pytest + @pytest.mark.parametrize('key value'.split(), + archival_mapping.items()) + def test_archival_to_version(key, value): + assert key in archival_mapping + assert value == archival_mapping[key] + """) + rec = testdir.inline_run() + rec.assertoutcome(passed=2) + def test_function_equality_with_callspec(self, testdir, tmpdir): items = testdir.getitems(""" import pytest diff -r 847d2afe11efe401500985ac99994009095404c2 -r b3da592fbc92a9fd0afb7019320f13f5dc1823f1 testing/test_parametrize_with_fixture.py --- a/testing/test_parametrize_with_fixture.py +++ /dev/null @@ -1,1 +0,0 @@ -import pytest https://bitbucket.org/hpk42/pytest/commits/e766eae72f12/ Changeset: e766eae72f12 User: hpk42 Date: 2013-09-07 09:16:35 Summary: Merged in paylogic/pytest/parametrize-fails-when-values-are (pull request #68) parametrize fails when values are unhashable - add test Affected #: 2 files diff -r 8ccfe395100dfe6be00805a25b2516aec702949a -r e766eae72f1254187119636fb4613b03fda00d62 testing/python/collect.py --- a/testing/python/collect.py +++ b/testing/python/collect.py @@ -329,6 +329,24 @@ reprec = testdir.inline_run() reprec.assertoutcome(passed=1) + def test_parametrize_with_non_hashable_values(self, testdir): + """Test parametrization with non-hashable values.""" + testdir.makepyfile(""" + archival_mapping = { + '1.0': {'tag': '1.0'}, + '1.2.2a1': {'tag': 'release-1.2.2a1'}, + } + + import pytest + @pytest.mark.parametrize('key value'.split(), + archival_mapping.items()) + def test_archival_to_version(key, value): + assert key in archival_mapping + assert value == archival_mapping[key] + """) + rec = testdir.inline_run() + rec.assertoutcome(passed=2) + def test_function_equality_with_callspec(self, testdir, tmpdir): items = testdir.getitems(""" import pytest diff -r 8ccfe395100dfe6be00805a25b2516aec702949a -r e766eae72f1254187119636fb4613b03fda00d62 testing/test_parametrize_with_fixture.py --- a/testing/test_parametrize_with_fixture.py +++ /dev/null @@ -1,1 +0,0 @@ -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. _______________________________________________ pytest-commit mailing list pytest-commit@python.org https://mail.python.org/mailman/listinfo/pytest-commit