Work around for longer object lifetimes on pypy

On pypy the subordinate LED objects in RGBLED composite objects do die
on failed construction ... eventually. Unfortunately it's not quick
enough to prevent the following tests from failing. As we can't know for
certain exactly which test is going to follow, it's best to simply clear
down the reservation table before each test.
This commit is contained in:
Dave Jones
2016-10-22 16:19:06 +01:00
parent d3c55d25a4
commit 4049ef5094
3 changed files with 3 additions and 0 deletions

View File

@@ -34,6 +34,7 @@ def setup_function(function):
def teardown_function(function):
Device._pin_factory.reset()
Device._reservations.clear()
def teardown_module(module):
# make sure we reset the default

View File

@@ -18,6 +18,7 @@ from gpiozero import *
def teardown_function(function):
Device._pin_factory.reset()
Device._reservations.clear()
def test_input_initial_values():

View File

@@ -22,6 +22,7 @@ from gpiozero import *
def teardown_function(function):
Device._pin_factory.reset()
Device._reservations.clear()
def test_output_initial_values():