From 53ad09c04b946b7c641569219c720a8649cb020f Mon Sep 17 00:00:00 2001 From: Jos Verlinde Date: Mon, 4 Nov 2024 21:44:26 +0000 Subject: [PATCH] tests: update test for @no_type_check --- tests/quality_tests/check_rp2/check_rp2/check_asm_pio.py | 9 +++++++++ .../check_rp2/check_rp2/check_no_type_check.py | 6 ++++++ 2 files changed, 15 insertions(+) diff --git a/tests/quality_tests/check_rp2/check_rp2/check_asm_pio.py b/tests/quality_tests/check_rp2/check_rp2/check_asm_pio.py index 9b3346225..5b5e583b1 100644 --- a/tests/quality_tests/check_rp2/check_rp2/check_asm_pio.py +++ b/tests/quality_tests/check_rp2/check_rp2/check_asm_pio.py @@ -7,9 +7,18 @@ # ref : https://docs.micropython.org/en/latest/rp2/quickref.html#programmable-io-pio """ from typing import no_type_check +import typing import rp2 from machine import Pin +import time + +@no_type_check +def foo() -> str: + return 12345 # No error! + + +# mypy: ignore-errors @no_type_check @rp2.asm_pio(set_init=rp2.PIO.OUT_LOW) def blink_1hz(): diff --git a/tests/quality_tests/check_rp2/check_rp2/check_no_type_check.py b/tests/quality_tests/check_rp2/check_rp2/check_no_type_check.py index a70e597a9..4fb5d0c53 100644 --- a/tests/quality_tests/check_rp2/check_rp2/check_no_type_check.py +++ b/tests/quality_tests/check_rp2/check_rp2/check_no_type_check.py @@ -9,7 +9,13 @@ from typing import no_type_check import rp2 from machine import Pin +import time +@no_type_check +def foo() -> str: + return 12345 # No error! + +# mypy: ignore-errors @no_type_check @rp2.asm_pio(set_init=0) def blink_1hz():