some python2.5/3.3 fixes of Brianna's parametrize improvements

This commit is contained in:
holger krekel 2013-07-16 15:43:20 +02:00
parent ca8281f229
commit 60a53c75a6
4 changed files with 9 additions and 8 deletions

View File

@ -1,2 +1,2 @@
#
__version__ = '2.4.0.dev5'
__version__ = '2.4.0.dev6'

View File

@ -2,7 +2,6 @@
import py
import inspect
import sys
from types import NoneType
import pytest
from _pytest.main import getfslineno
from _pytest.mark import MarkDecorator, MarkInfo
@ -12,6 +11,8 @@ from py._code.code import TerminalRepr
import _pytest
cutdir = py.path.local(_pytest.__file__).dirpath()
NoneType = type(None)
callable = py.builtin.callable
def getimfunc(func):

View File

@ -12,7 +12,7 @@ def main():
name='pytest',
description='py.test: simple powerful testing with Python',
long_description = long_description,
version='2.4.0.dev5',
version='2.4.0.dev6',
url='http://pytest.org',
license='MIT license',
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],

View File

@ -99,12 +99,12 @@ class TestMetafunc:
def func(x, y): pass
metafunc = self.Metafunc(func)
with pytest.raises(ValueError):
metafunc.parametrize("x", [1,2], ids=['basic'])
pytest.raises(ValueError, lambda:
metafunc.parametrize("x", [1,2], ids=['basic']))
with pytest.raises(ValueError):
pytest.raises(ValueError, lambda:
metafunc.parametrize(("x","y"), [("abc", "def"),
("ghi", "jkl")], ids=["one"])
("ghi", "jkl")], ids=["one"]))
def test_parametrize_with_userobjects(self):
def func(x, y): pass
@ -140,7 +140,7 @@ class TestMetafunc:
(True, False),
(None, None),
(list("six"), [66, 66]),
({7}, set("seven")),
(set([7]), set("seven")),
(tuple("eight"), (8, -8, 8))
])
assert result == ["1.0--1.1",