tests: fix py312 issues

This commit is contained in:
bastimeyer 2023-07-06 00:34:38 +02:00 committed by Sebastian Meyer
parent 2a4148eea2
commit 4c6fdb1178
4 changed files with 4 additions and 3 deletions

View File

@ -302,7 +302,7 @@ class TestPlayerOutput:
assert not playeroutput.player.terminate.called # type: ignore
playeroutput.close()
assert playeroutput.player.terminate.called_once # type: ignore
assert playeroutput.player.terminate.call_count == 1 # type: ignore
@pytest.mark.parametrize(("playeroutput", "mock_which", "expected", "warns"), [
pytest.param(

View File

@ -567,6 +567,7 @@ class _TestCLIMainLogging(unittest.TestCase):
patch("streamlink_cli.main.CONFIG_FILES", []), \
patch("streamlink_cli.main.setup_streamlink"), \
patch("streamlink_cli.main.setup_plugins"), \
patch("streamlink_cli.argparser.find_default_player"), \
patch("streamlink.session.Streamlink.load_builtin_plugins"), \
patch("sys.argv") as mock_argv:
mock_argv.__getitem__.side_effect = lambda x: argv[x]

View File

@ -231,7 +231,7 @@ class TestMixinStreamHLS(unittest.TestCase):
def called(self, item, once=False):
mock = self.get_mock(item)
return mock.called_once if once else mock.called
return mock.call_count == 1 if once else mock.called
def url(self, item):
return item.url(self.id())

View File

@ -27,7 +27,7 @@ class TestDASHStreamParseManifest:
response = requests_mock.register_uri("GET", "http://test/manifest.mpd", **getattr(request, "param", {}))
called_once = "nomockedhttprequest" not in request.keywords
yield
assert response.called_once is called_once
assert (response.call_count == 1) is called_once
@pytest.fixture()
def parse_xml(self, monkeypatch: pytest.MonkeyPatch):