Skip to content

Commit 1baf46a

Browse files
committed
move tests to pyutest test/ dir
1 parent eca0e1b commit 1baf46a

File tree

3 files changed

+12
-10
lines changed

3 files changed

+12
-10
lines changed

examples/generic_aio.py renamed to tests/test_generic_agnostic_board_analogio.py

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -99,27 +99,29 @@ def test_Ax_INPUT_WAVE_SINE():
9999
pin_sine_wave = analogio.AnalogIn(board.Ax_INPUT_WAVE_SINE)
100100

101101
# Run through the sine wave once
102-
for i in range(len(sine_wave)):
103-
assert pin_sine_wave.value == sine_wave[i]
102+
for i, expected_value in enumerate(sine_wave):
103+
assert pin_sine_wave.value == expected_value
104+
104105

105106
# Run through the sine wave again to ensure it loops back correctly
106-
for i in range(len(sine_wave)):
107-
assert pin_sine_wave.value == sine_wave[i]
107+
for i, expected_value in enumerate(sine_wave):
108+
assert pin_sine_wave.value == expected_value
108109

109110
pin_sine_wave.deinit()
110111

111112

112113
def test_Ax_INPUT_WAVE_SAW():
113114
"""Test sawtooth wave from pin Ax_INPUT_WAVE_SAW"""
114115
assert board.board_id == "GENERIC_AGNOSTIC_BOARD"
115-
pin_sine_wave = analogio.AnalogIn(board.Ax_INPUT_WAVE_SAW)
116+
pin_saw_wave = analogio.AnalogIn(board.Ax_INPUT_WAVE_SAW)
116117

117118
# Run through the sine wave once
118119
for i in range(len(sawtooth_wave)):
119-
assert pin_sine_wave.value == sawtooth_wave[i]
120+
assert pin_saw_wave.value == sawtooth_wave[i]
120121

121122
# Run through the sine wave again to ensure it loops back correctly
122123
for i in range(len(sawtooth_wave)):
123-
assert pin_sine_wave.value == sawtooth_wave[i]
124+
assert pin_saw_wave.value == sawtooth_wave[i]
124125

125-
pin_sine_wave.deinit()
126+
127+
pin_saw_wave.deinit()
File renamed without changes.

examples/generic_i2c.py renamed to tests/test_generic_agnostic_board_i2c.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
# SPDX-FileCopyrightText: 2024 Brent Rubell for Adafruit Industries
22
#
33
# SPDX-License-Identifier: MIT
4-
import pytest
4+
import pytest # pylint: disable=unused-import
55
import busio
6-
from board import *
6+
from board import SCL, SDA
77

88
def test_i2c_scan_random():
99
i2c = busio.I2C(SCL, SDA)

0 commit comments

Comments
 (0)