Sleep? #11196
Sleep?
#11196
-
The framework is really amazing, but I've been stuck lately. Say, I have a test: import time
import pytest
from my_module import my_fixture
def test_my_fixture(my_fixture):
my_fixture.start_the_test_sequence()
time.sleep(100)
# gather results I'm testing hardware, which means I need to wait for hardware, power sources, network adapters etc. etc. When this code gets to I would like for it to not block my fixture. Any help? |
Beta Was this translation helpful? Give feedback.
Answered by
The-Compiler
Jul 11, 2023
Replies: 1 comment 4 replies
-
Can you elaborate on what you mean with "not block the fixture"? What should happen instead? How exactly do you want it to sleep (i.e. wait), yet apparently not do that? |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I still fail to see how a multi-threaded architecture and an asynchronous sleep come into play. Many of my customers (I give pytest company trainings) test hardware using pytest, and so far I haven't seen a need for this. If you help me understand your use-case, I might be able to give you a better recommendation (perhaps you're looking for something like pytest-asyncio?).
As for making pytest thread-safe, I'd highly recommend opening an issue first and discussing on whether it's a desirable goal at all. Personally, I think the additional complexity costs by far outweigh the (very limited) use-cases it might be needed for.