Configure pylint in pyproject and delint

This commit is contained in:
James R. Barlow
2022-06-12 00:30:44 -07:00
parent d640c2ded3
commit b17fb61389
33 changed files with 323 additions and 157 deletions
+4 -2
View File
@@ -8,7 +8,6 @@
import datetime
import warnings
from datetime import timezone
from os import fspath
from shutil import copyfile
import pikepdf
@@ -326,6 +325,9 @@ def test_metadata_fixup_warning(resources, outdir, caplog):
assert any(record.levelname == 'WARNING' for record in caplog.records)
XMP_MAGIC = b'W5M0MpCehiHzreSzNTczkc9d'
def test_prevent_gs_invalid_xml(resources, outdir):
generate_pdfa_ps(outdir / 'pdfa.ps')
copyfile(resources / 'trivial.pdf', outdir / 'layers.rendered.pdf')
@@ -352,7 +354,7 @@ def test_prevent_gs_invalid_xml(resources, outdir):
contents = (outdir / 'pdfa.pdf').read_bytes()
# Since the XML may be invalid, we scan instead of actually feeding it
# to a parser.
XMP_MAGIC = b'W5M0MpCehiHzreSzNTczkc9d'
xmp_start = contents.find(XMP_MAGIC)
xmp_end = contents.rfind(b'<?xpacket end', xmp_start)
assert 0 < xmp_start < xmp_end