tests: close event loop at exit

prevents a nice segfault
This commit is contained in:
mathieui 2023-12-28 20:37:21 +01:00
parent 31fe7f7e06
commit 6765f84133
No known key found for this signature in database
GPG Key ID: C59F84CEEFD616E3

View File

@ -3,6 +3,7 @@
# Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout # Copyright (C) 2010 Nathanael C. Fritz, Lance J.T. Stout
# This file is part of Slixmpp. # This file is part of Slixmpp.
# See the file LICENSE for copying permission. # See the file LICENSE for copying permission.
import atexit
import unittest import unittest
from queue import Queue from queue import Queue
from xml.parsers.expat import ExpatError from xml.parsers.expat import ExpatError
@ -750,3 +751,9 @@ class SlixTest(unittest.TestCase):
Error.namespace = 'jabber:client' Error.namespace = 'jabber:client'
for st in Message, Iq, Presence: for st in Message, Iq, Presence:
register_stanza_plugin(st, Error) register_stanza_plugin(st, Error)
@atexit.register
def cleanup():
loop = asyncio.get_event_loop()
loop.close()