Skip to content

Commit

Permalink
Backport #8896
Browse files Browse the repository at this point in the history
  • Loading branch information
hroncok authored and nicoddemus committed Aug 27, 2021
1 parent 69212d1 commit d9b8f7c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 14 deletions.
5 changes: 1 addition & 4 deletions testing/python/metafunc.py
Original file line number Diff line number Diff line change
Expand Up @@ -448,10 +448,7 @@ def test_idmaker_enum(self) -> None:
enum = pytest.importorskip("enum")
e = enum.Enum("Foo", "one, two")
result = idmaker(("a", "b"), [pytest.param(e.one, e.two)])
if sys.version_info[:2] >= (3, 10):
assert result == ["one-two"]
else:
assert result == ["Foo.one-Foo.two"]
assert result == ["Foo.one-Foo.two"]

def test_idmaker_idfn(self) -> None:
"""#351"""
Expand Down
14 changes: 4 additions & 10 deletions testing/test_pytester.py
Original file line number Diff line number Diff line change
Expand Up @@ -741,16 +741,10 @@ def test_run_result_repr() -> None:

# known exit code
r = pytester.RunResult(1, outlines, errlines, duration=0.5)
if sys.version_info[:2] >= (3, 10):
assert repr(r) == (
"<RunResult ret=TESTS_FAILED len(stdout.lines)=3"
" len(stderr.lines)=4 duration=0.50s>"
)
else:
assert repr(r) == (
"<RunResult ret=ExitCode.TESTS_FAILED len(stdout.lines)=3"
" len(stderr.lines)=4 duration=0.50s>"
)
assert (
repr(r) == "<RunResult ret=ExitCode.TESTS_FAILED len(stdout.lines)=3"
" len(stderr.lines)=4 duration=0.50s>"
)

# unknown exit code: just the number
r = pytester.RunResult(99, outlines, errlines, duration=0.5)
Expand Down

0 comments on commit d9b8f7c

Please sign in to comment.