Skip to content

Commit

Permalink
fix rebase mistake and apply a few style fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
RonnyPfannschmidt committed Jan 19, 2017
1 parent 5fe5acf commit afa0450
Showing 1 changed file with 13 additions and 9 deletions.
22 changes: 13 additions & 9 deletions testing/python/metafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,9 @@ def test_idmaker_autoname(self):
pytest.param(object(), object())])
assert result == ["a0-1.0", "a1-b1"]
# unicode mixing, issue250
result = idmaker((py.builtin._totext("a"), "b"), [pytest.param({}, b'\xc3\xb4')])
result = idmaker(
(py.builtin._totext("a"), "b"),
[pytest.param({}, b'\xc3\xb4')])
assert result == ['a0-\\xc3\\xb4']

def test_idmaker_with_bytes_regex(self):
Expand Down Expand Up @@ -258,7 +260,7 @@ def test_idmaker_enum(self):
from _pytest.python import idmaker
enum = pytest.importorskip("enum")
e = enum.Enum("Foo", "one, two")
result = idmaker(("a", "b"), [(e.one, e.two)])
result = idmaker(("a", "b"), [pytest.param(e.one, e.two)])
assert result == ["Foo.one-Foo.two"]

@pytest.mark.issue351
Expand All @@ -269,9 +271,10 @@ def ids(val):
if isinstance(val, Exception):
return repr(val)

result = idmaker(("a", "b"), [pytest.param(10.0, IndexError()),
pytest.param(20, KeyError()),
pytest.param("three", [1, 2, 3]),
result = idmaker(("a", "b"), [
pytest.param(10.0, IndexError()),
pytest.param(20, KeyError()),
pytest.param("three", [1, 2, 3]),
], idfn=ids)
assert result == ["10.0-IndexError()",
"20-KeyError()",
Expand Down Expand Up @@ -307,10 +310,11 @@ def ids(val):

rec = WarningsRecorder()
with rec:
idmaker(("a", "b"), [pytest.param(10.0, IndexError()),
pytest.param(20, KeyError()),
pytest.param("three", [1, 2, 3]),
]], idfn=ids)
idmaker(("a", "b"), [
pytest.param(10.0, IndexError()),
pytest.param(20, KeyError()),
pytest.param("three", [1, 2, 3]),
], idfn=ids)

assert [str(i.message) for i in rec.list] == [
"Raised while trying to determine id of parameter a at position 0."
Expand Down

0 comments on commit afa0450

Please sign in to comment.