#2149·channels

Test fail when run under something - ChannelsLiveServerTestCase

Author: enzofrntCreated Apr 12, 2025Updated Jun 12, 2025

Hi,
I know the issue title might sound a bit strange, but I’m not sure how to better describe what’s going on.

I'm currently working on test cases to improve django-eventstream.

Here are the related tests:
tests/test_stream.py

When I run them individually using:

bash
pytest tests/test_stream.py

everything works fine. But when I run them with:

bash
pytest

or through:

bash
tox

they start failing. It seems like when the tests are executed along with others, or maybe under different process contexts, something changes — perhaps the test priority or isolation — and some of the parsing logic in the code fails to retrieve all the events that were sent.

Is there a way to make sure my tests remain stable and work even when executed with others or through tox?

Thanks in advance!