mirror of
https://github.com/micropython/micropython.git
synced 2026-01-07 04:30:24 +01:00
tests/float: Make output of math function tests more readable.
By explicitly naming the function, its arguments, and result. Signed-off-by: Damien George <damien@micropython.org>
This commit is contained in:
@@ -44,9 +44,9 @@ functions = [
|
||||
]
|
||||
|
||||
for function_name, function, test_vals in functions:
|
||||
print(function_name)
|
||||
for value in test_vals:
|
||||
try:
|
||||
print("{:.4g}".format(function(value)))
|
||||
ans = "{:.4g}".format(function(value))
|
||||
except ValueError as e:
|
||||
print(str(e))
|
||||
ans = str(e)
|
||||
print("{}({:.4g}) = {}".format(function_name, value, ans))
|
||||
|
||||
Reference in New Issue
Block a user