From 433a19b6dab6a60b8b2d3f55558c82e05f00b7bf Mon Sep 17 00:00:00 2001 From: Martin O'Hanlon Date: Wed, 3 May 2023 11:32:30 +0100 Subject: [PATCH] fixed test_pwm_output_device_alt_values --- tests/test_picozero.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/test_picozero.py b/tests/test_picozero.py index f47ee5d..d1cbcd0 100644 --- a/tests/test_picozero.py +++ b/tests/test_picozero.py @@ -179,8 +179,10 @@ def test_pwm_output_device_alt_values(self): self.assertEqual(d.freq, 200) d.off() - # pwm returns 1 less than the duty_factor unless the duty is set to the maximum 65535 - self.assertEqual(d._pwm.duty_u16(), 9999) + # prior to micropython v1.20 PWM returned 1 less than the duty_factor + # unless the duty was set to the maximum 65535 + # self.assertEqual(d._pwm.duty_u16(), 9999) + self.assertEqual(d._pwm.duty_u16(), 10000) self.assertAlmostEqual(d.value, 0, places=2) d.on()