From eebffb2b5b46dae65eeef8290146112348415221 Mon Sep 17 00:00:00 2001 From: Damien George Date: Tue, 29 Oct 2019 22:01:47 +1100 Subject: [PATCH] tests/basics: Automatically skip tests that use str/bytes modulo-format. --- tests/basics/bytes_format_modulo.py | 7 +++++++ tests/basics/string_format_modulo.py | 6 ++++++ tests/basics/string_format_modulo_int.py | 6 ++++++ 3 files changed, 19 insertions(+) diff --git a/tests/basics/bytes_format_modulo.py b/tests/basics/bytes_format_modulo.py index 70246e72dc..b928f593e0 100644 --- a/tests/basics/bytes_format_modulo.py +++ b/tests/basics/bytes_format_modulo.py @@ -1,4 +1,11 @@ # This test requires CPython3.5 + +try: + b'' % () +except TypeError: + print("SKIP") + raise SystemExit + print(b"%%" % ()) print(b"=%d=" % 1) print(b"=%d=%d=" % (1, 2)) diff --git a/tests/basics/string_format_modulo.py b/tests/basics/string_format_modulo.py index 77bbcfbe36..021b5f08d2 100644 --- a/tests/basics/string_format_modulo.py +++ b/tests/basics/string_format_modulo.py @@ -1,3 +1,9 @@ +try: + '' % () +except TypeError: + print("SKIP") + raise SystemExit + print("%%" % ()) print("=%s=" % 1) print("=%s=%s=" % (1, 2)) diff --git a/tests/basics/string_format_modulo_int.py b/tests/basics/string_format_modulo_int.py index d1f29db220..d057522bfc 100644 --- a/tests/basics/string_format_modulo_int.py +++ b/tests/basics/string_format_modulo_int.py @@ -1,5 +1,11 @@ # test string modulo formatting with int values +try: + '' % () +except TypeError: + print("SKIP") + raise SystemExit + # basic cases print("%d" % 10) print("%+d" % 10)