summaryrefslogtreecommitdiffstatshomepage
path: root/examples/natmod/features2/test.py
diff options
context:
space:
mode:
authorDamien George <damien.p.george@gmail.com>2020-02-27 15:36:53 +1100
committerDamien George <damien.p.george@gmail.com>2020-02-28 10:33:03 +1100
commit69661f3343bedf86e514337cff63d96cc42f8859 (patch)
treeaf5dfb380ffdb75dda84828f63cf9d840d992f0f /examples/natmod/features2/test.py
parent3f39d18c2b884d32f0443e2e8114ff9d7a14d718 (diff)
downloadmicropython-69661f3343bedf86e514337cff63d96cc42f8859.tar.gz
micropython-69661f3343bedf86e514337cff63d96cc42f8859.zip
all: Reformat C and Python source code with tools/codeformat.py.
This is run with uncrustify 0.70.1, and black 19.10b0.
Diffstat (limited to 'examples/natmod/features2/test.py')
-rw-r--r--examples/natmod/features2/test.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/examples/natmod/features2/test.py b/examples/natmod/features2/test.py
index 2e9db00f44..5ac80120d7 100644
--- a/examples/natmod/features2/test.py
+++ b/examples/natmod/features2/test.py
@@ -2,20 +2,22 @@
import array
+
def isclose(a, b):
return abs(a - b) < 1e-3
+
def test():
tests = [
isclose(add(0.1, 0.2), 0.3),
isclose(add_f(0.1, 0.2), 0.3),
]
- ar = array.array('f', [1, 2, 3.5])
+ ar = array.array("f", [1, 2, 3.5])
productf(ar)
tests.append(isclose(ar[0], 7))
- if 'add_d' in globals():
+ if "add_d" in globals():
tests.append(isclose(add_d(0.1, 0.2), 0.3))
print(tests)
@@ -23,4 +25,5 @@ def test():
if not all(tests):
raise SystemExit(1)
+
test()