tests/basics: Automatically skip tests that use str/bytes modulo-format.

This commit is contained in:
Damien George 2019-10-29 22:01:47 +11:00
parent 52299ed3f0
commit eebffb2b5b
3 changed files with 19 additions and 0 deletions

View File

@ -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))

View File

@ -1,3 +1,9 @@
try:
'' % ()
except TypeError:
print("SKIP")
raise SystemExit
print("%%" % ())
print("=%s=" % 1)
print("=%s=%s=" % (1, 2))

View File

@ -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)