Skip to content

Commit

Permalink
Update test_printt for Python 3.13
Browse files Browse the repository at this point in the history
  • Loading branch information
domdfcoding committed Jun 17, 2024
1 parent d17cc36 commit dab1f3b
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,11 +124,17 @@ def test_printr(obj, expects, capsys):
assert re.match(expects, stdout[0])


if sys.version_info >= (3, 13):
pure_posix_path_expected = "<class 'pathlib._local.PurePosixPath'>"
else:
pure_posix_path_expected = "<class 'pathlib.PurePosixPath'>"


@pytest.mark.parametrize(
"obj, expects",
[
("This is a test", "<class 'str'>"),
(pathlib.PurePosixPath("foo.txt"), "<class 'pathlib.PurePosixPath'>"),
(pathlib.PurePosixPath("foo.txt"), pure_posix_path_expected),
(1234, "<class 'int'>"),
(12.34, "<class 'float'>"),
(CustomRepr(), "<class 'tests.test_utils.CustomRepr'>"),
Expand Down

0 comments on commit dab1f3b

Please sign in to comment.