Problem: I am trying to test some hardware using the py.test framework (their fixtures are really useful, there's no other framework with such functionality as far as I am aware). The thing is, the running thread seems to block out any other functionality in my test.
I've tried launching the hardware_fixture running logic in a thread - yet, this doesn't seem to work for me - the thread stops responding once the time.sleep
call is done.
Example:
import pytest
from time import sleep
from hardware_library import hardware_fixture
def hardware_test(hardware_fixture):
hardware_fixture.start_the_testing_sequence()
sleep(120) # or whatever
Here's the thing - my hardware_fixture
seems blocked by the time.sleep
call.
Shall I fork the py.test, and modify it to run the test execution in a thread, or is there a simpler, better way?
How can I make everything work? I would really enjoy the non-blocking sleep.