fixes error with escape character in regex

This commit is contained in:
onyx-and-iris 2023-08-13 16:51:27 +01:00
parent df473d89ae
commit 2bba0ff67a

View File

@ -1,3 +1,5 @@
import re
import pytest import pytest
import voicemeeterlib import voicemeeterlib
@ -30,11 +32,11 @@ class TestErrors:
"No config with name 'unknown' is loaded into memory", "No config with name 'unknown' is loaded into memory",
f"Known configs: {list(vm.configs.keys())}", f"Known configs: {list(vm.configs.keys())}",
) )
with pytest.raises(voicemeeterlib.error.VMError) as exc_info:
vm.apply_config("unknown")
e = exc_info.value with pytest.raises(
assert e.message == "\n".join(EXPECTED_MSG) voicemeeterlib.error.VMError, match=re.escape("\n".join(EXPECTED_MSG))
):
vm.apply_config("unknown")
def test_it_tests_an_invalid_config_key(self): def test_it_tests_an_invalid_config_key(self):
CONFIG = { CONFIG = {