some python2.5/3.3 fixes of Brianna's parametrize improvements
This commit is contained in:
parent
ca8281f229
commit
60a53c75a6
|
@ -1,2 +1,2 @@
|
||||||
#
|
#
|
||||||
__version__ = '2.4.0.dev5'
|
__version__ = '2.4.0.dev6'
|
||||||
|
|
|
@ -2,7 +2,6 @@
|
||||||
import py
|
import py
|
||||||
import inspect
|
import inspect
|
||||||
import sys
|
import sys
|
||||||
from types import NoneType
|
|
||||||
import pytest
|
import pytest
|
||||||
from _pytest.main import getfslineno
|
from _pytest.main import getfslineno
|
||||||
from _pytest.mark import MarkDecorator, MarkInfo
|
from _pytest.mark import MarkDecorator, MarkInfo
|
||||||
|
@ -12,6 +11,8 @@ from py._code.code import TerminalRepr
|
||||||
import _pytest
|
import _pytest
|
||||||
cutdir = py.path.local(_pytest.__file__).dirpath()
|
cutdir = py.path.local(_pytest.__file__).dirpath()
|
||||||
|
|
||||||
|
NoneType = type(None)
|
||||||
|
|
||||||
callable = py.builtin.callable
|
callable = py.builtin.callable
|
||||||
|
|
||||||
def getimfunc(func):
|
def getimfunc(func):
|
||||||
|
|
2
setup.py
2
setup.py
|
@ -12,7 +12,7 @@ def main():
|
||||||
name='pytest',
|
name='pytest',
|
||||||
description='py.test: simple powerful testing with Python',
|
description='py.test: simple powerful testing with Python',
|
||||||
long_description = long_description,
|
long_description = long_description,
|
||||||
version='2.4.0.dev5',
|
version='2.4.0.dev6',
|
||||||
url='http://pytest.org',
|
url='http://pytest.org',
|
||||||
license='MIT license',
|
license='MIT license',
|
||||||
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
platforms=['unix', 'linux', 'osx', 'cygwin', 'win32'],
|
||||||
|
|
|
@ -99,12 +99,12 @@ class TestMetafunc:
|
||||||
def func(x, y): pass
|
def func(x, y): pass
|
||||||
metafunc = self.Metafunc(func)
|
metafunc = self.Metafunc(func)
|
||||||
|
|
||||||
with pytest.raises(ValueError):
|
pytest.raises(ValueError, lambda:
|
||||||
metafunc.parametrize("x", [1,2], ids=['basic'])
|
metafunc.parametrize("x", [1,2], ids=['basic']))
|
||||||
|
|
||||||
with pytest.raises(ValueError):
|
pytest.raises(ValueError, lambda:
|
||||||
metafunc.parametrize(("x","y"), [("abc", "def"),
|
metafunc.parametrize(("x","y"), [("abc", "def"),
|
||||||
("ghi", "jkl")], ids=["one"])
|
("ghi", "jkl")], ids=["one"]))
|
||||||
|
|
||||||
def test_parametrize_with_userobjects(self):
|
def test_parametrize_with_userobjects(self):
|
||||||
def func(x, y): pass
|
def func(x, y): pass
|
||||||
|
@ -140,7 +140,7 @@ class TestMetafunc:
|
||||||
(True, False),
|
(True, False),
|
||||||
(None, None),
|
(None, None),
|
||||||
(list("six"), [66, 66]),
|
(list("six"), [66, 66]),
|
||||||
({7}, set("seven")),
|
(set([7]), set("seven")),
|
||||||
(tuple("eight"), (8, -8, 8))
|
(tuple("eight"), (8, -8, 8))
|
||||||
])
|
])
|
||||||
assert result == ["1.0--1.1",
|
assert result == ["1.0--1.1",
|
||||||
|
|
Loading…
Reference in New Issue