From 74609cfa1ba86d8ec08c15e551eafdb8d8137c89 Mon Sep 17 00:00:00 2001 From: luk3yx Date: Fri, 8 Apr 2022 13:24:07 +1200 Subject: [PATCH] Fix broken test --- test_miniirc.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test_miniirc.py b/test_miniirc.py index ed9885b..cee2932 100644 --- a/test_miniirc.py +++ b/test_miniirc.py @@ -201,17 +201,21 @@ def test_get_ca_certs(): def test_start_main_loop(monkeypatch): irc = DummyIRC() thread = None + event = threading.Event() def main(self): nonlocal thread assert self is irc thread = threading.current_thread() + event.set() monkeypatch.setattr(DummyIRC, '_main', main) assert irc._main_thread is None irc._start_main_loop() - assert irc._main_thread is thread + main_thread = irc._main_thread + assert event.wait(1) + assert main_thread is irc._main_thread is thread assert not hasattr(irc, '_main_lock') def test_connection(monkeypatch):