Merge pull request #3125 from fonttools/tests-warnings

[Tests] Silence a few deprecation warnings
This commit is contained in:
Cosimo Lupo 2023-05-25 13:06:09 +01:00 committed by GitHub
commit 62bca25c04
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 9 additions and 6 deletions

View File

@ -391,6 +391,7 @@ class GlyfTableTest(unittest.TestCase):
font["hmtx"].metrics = {".notdef": (100, 0)} font["hmtx"].metrics = {".notdef": (100, 0)}
font["head"] = newTable("head") font["head"] = newTable("head")
font["head"].unitsPerEm = 1000 font["head"].unitsPerEm = 1000
with pytest.deprecated_call():
self.assertEqual( self.assertEqual(
font["glyf"].getPhantomPoints(".notdef", font, 0), font["glyf"].getPhantomPoints(".notdef", font, 0),
[(0, 0), (100, 0), (0, 0), (0, -1000)], [(0, 0), (100, 0), (0, 0), (0, -1000)],

View File

@ -144,6 +144,7 @@ class TTGlyphSetTest(object):
assert list(glyphset.keys()) == [".notdef", "I"] assert list(glyphset.keys()) == [".notdef", "I"]
assert "I" in glyphset assert "I" in glyphset
with pytest.deprecated_call():
assert glyphset.has_key("I") # we should really get rid of this... assert glyphset.has_key("I") # we should really get rid of this...
assert len(glyphset) == 2 assert len(glyphset) == 2

View File

@ -51,6 +51,7 @@ def fvarAxes():
def _get_coordinates(varfont, glyphname): def _get_coordinates(varfont, glyphname):
# converts GlyphCoordinates to a list of (x, y) tuples, so that pytest's # converts GlyphCoordinates to a list of (x, y) tuples, so that pytest's
# assert will give us a nicer diff # assert will give us a nicer diff
with pytest.deprecated_call():
return list(varfont["glyf"].getCoordinatesAndControls(glyphname, varfont)[0]) return list(varfont["glyf"].getCoordinatesAndControls(glyphname, varfont)[0])