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((py.builtin._totext("a"), "b"), [({}, '\xc3\xb4')]) + assert result == ['a0-\xc3\xb4'] def test_addcall_and_parametrize(self):