Syntax simplifications
- Drop trailing comma inside trivial tuple
- Use r"""...""" for string containing ", as \" inside r"..." is taken literally
(I'm surprised it works!)
- Use ['"] instead of ('|")
- Also adjust the inner [^'] to [^'"] for consistency
This commit is contained in:
parent
af1d537970
commit
b41cc1d0fc
|
|
@ -486,7 +486,7 @@ def _pdfjs_version() -> str:
|
|||
else:
|
||||
pdfjs_file = pdfjs_file.decode('utf-8')
|
||||
version_re = re.compile(
|
||||
r"^ *(PDFJS\.version|(var|const) pdfjsVersion) = ('|\")(?P<version>[^']+)('|\");$",
|
||||
r"""^ *(PDFJS\.version|(var|const) pdfjsVersion) = ['"](?P<version>[^'"]+)['"];$""",
|
||||
re.MULTILINE)
|
||||
|
||||
match = version_re.search(pdfjs_file)
|
||||
|
|
|
|||
|
|
@ -71,13 +71,13 @@ def test_timeout_set_interval(qtbot):
|
|||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
"elapsed_ms,expected",
|
||||
"elapsed_ms, expected",
|
||||
[
|
||||
(0, False,),
|
||||
(1, False,),
|
||||
(600, True,),
|
||||
(999, True,),
|
||||
(1000, True,),
|
||||
(0, False),
|
||||
(1, False),
|
||||
(600, True),
|
||||
(999, True),
|
||||
(1000, True),
|
||||
],
|
||||
)
|
||||
def test_early_timeout_check(qtbot, mocker, elapsed_ms, expected):
|
||||
|
|
|
|||
Loading…
Reference in New Issue