1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
holger krekel 1677d28 issue250 unicode/str mixes in parametrization names and values now works; Wed Feb 13
diff -ur pytest-2.3.4.orig/_pytest/python.py pytest-2.3.4/_pytest/python.py
--- _pytest/python.py 2012-11-20 14:07:28.000000000 +0800
+++ _pytest/python.py 2013-02-14 09:55:16.369853793 +0800
@@ -730,7 +730,7 @@
this_id = []
for nameindex, val in enumerate(valset):
if not isinstance(val, (float, int, str)):
- this_id.append(argnames[nameindex]+str(valindex))
+ this_id.append(str(argnames[nameindex])+str(valindex))
else:
this_id.append(str(val))
idlist.append("-".join(this_id))
diff -ur pytest-2.3.4.orig/testing/python/metafunc.py pytest-2.3.4/testing/python/metafunc.py
--- testing/python/metafunc.py 2012-11-20 14:07:28.000000000 +0800
+++ testing/python/metafunc.py 2013-02-14 10:01:43.442834535 +0800
@@ -106,6 +106,7 @@
assert metafunc._calls[2].id == "x1-a"
assert metafunc._calls[3].id == "x1-b"
+ @pytest.mark.issue250
def test_idmaker_autoname(self):
from _pytest.python import idmaker
result = idmaker(("a", "b"), [("string", 1.0),
@@ -115,6 +116,9 @@
result = idmaker(("a", "b"), [(object(), 1.0),
(object(), object())])
assert result == ["a0-1.0", "a1-b1"]
+ # unicode mixing, issue250
+ result = idmaker((u"a", "b"), [({}, '\xc3\xb4')])
+ assert result == ['a0-\xc3\xb4']
def test_addcall_and_parametrize(self):
diff -ur pytest-2.3.4.orig/tox.ini pytest-2.3.4/tox.ini
--- tox.ini 2012-11-20 14:07:28.000000000 +0800
+++ tox.ini 2013-02-14 10:04:26.066826443 +0800
@@ -50,6 +50,13 @@
commands=py.test --doctest-modules _pytest
deps=
++[testenv:py32]
+deps=
+ :pypi:nose
+
+[testenv:py33]
+deps=
+ :pypi:nose
[testenv:doc]
basepython=python
|