v0.102.1: Connect to Mumble says when a server hangs up straight away (its flood protection after many connects) instead of an empty error
This commit is contained in:
@@ -1,3 +1,3 @@
|
||||
"""LinTunes — iTunes-style music library manager and player for Linux."""
|
||||
|
||||
__version__ = "0.102.0"
|
||||
__version__ = "0.102.1"
|
||||
|
||||
@@ -16,6 +16,22 @@ from lintunes.mumble.sink import (
|
||||
FRAME_MS, MumbleSink, SAMPLES, apply_gain, bitrate_for)
|
||||
|
||||
|
||||
@pytest.fixture(autouse=True)
|
||||
def _app(qapp):
|
||||
"""Every test here holds the QApplication. Mixing tests that make Qt
|
||||
objects with ones that don't freed its wrapper mid-file now and then
|
||||
(sip's release_QApplication, a segfault in a later test)."""
|
||||
return qapp
|
||||
|
||||
|
||||
def _delete(obj):
|
||||
"""Deleted now, not left for the end of the session: a Qt object still
|
||||
alive when pytest drops the QApplication segfaulted in sip."""
|
||||
from PyQt6.QtCore import QCoreApplication, QEvent
|
||||
obj.deleteLater()
|
||||
QCoreApplication.sendPostedEvents(None, QEvent.Type.DeferredDelete.value)
|
||||
|
||||
|
||||
@pytest.fixture
|
||||
def xdg(tmp_path, monkeypatch):
|
||||
monkeypatch.setenv("XDG_CONFIG_HOME", str(tmp_path / "config"))
|
||||
@@ -357,6 +373,7 @@ def test_sink_generations_and_failure(qapp):
|
||||
assert gone == ["gone"] and not sink.is_playing()
|
||||
assert not sink.can_play(_track("/x.m4p", "Protected AAC audio file"))
|
||||
assert sink.bitrate() == 96000
|
||||
_delete(sink)
|
||||
|
||||
|
||||
def test_heard_position_trails_what_was_sent(qapp):
|
||||
@@ -366,6 +383,7 @@ def test_heard_position_trails_what_was_sent(qapp):
|
||||
assert sink._heard(stream) == 1000
|
||||
stream.frames_sent = 50
|
||||
assert sink._heard(stream) == 1000 + 50 * FRAME_MS - 200
|
||||
_delete(sink)
|
||||
|
||||
|
||||
# ---- settings ----
|
||||
@@ -388,6 +406,7 @@ def test_dialog_takes_a_typed_address(qapp):
|
||||
dialog._address.setText("other.example")
|
||||
dialog._accept()
|
||||
assert dialog.selected_server.host == "other.example"
|
||||
_delete(dialog)
|
||||
|
||||
|
||||
# ---- the window ----
|
||||
@@ -403,6 +422,9 @@ def window(qapp, tmp_path):
|
||||
qapp.processEvents()
|
||||
yield win
|
||||
win.close()
|
||||
# Deleted now, not left for the end of the session: a window still
|
||||
# alive when pytest drops the QApplication segfaulted in sip.
|
||||
_delete(win)
|
||||
|
||||
|
||||
def test_menu_has_mumble_and_joins_the_current_server(window, monkeypatch):
|
||||
|
||||
Reference in New Issue
Block a user