micropython/tests/basics/builtin_pow3.py
Paul Sokolovsky 3ab6aa3a6d tests/basic: Split tests into working with small ints and not working.
Tests which don't work with small ints are suffixed with _intbig.py. Some
of these may still work with long long ints and need to be reclassified
later.
2017-03-04 00:13:27 +03:00

26 lines
458 B
Python

# test builtin pow() with integral values
# 3 arg version
try:
print(pow(3, 4, 7))
except NotImplementedError:
import sys
print("SKIP")
sys.exit()
# 3 arg pow is defined to only work on integers
try:
print(pow("x", 5, 6))
except TypeError:
print("TypeError expected")
try:
print(pow(4, "y", 6))
except TypeError:
print("TypeError expected")
try:
print(pow(4, 5, "z"))
except TypeError:
print("TypeError expected")