[Tests] Silence a few deprecation warnings

This commit is contained in:
Behdad Esfahbod 2023-05-24 14:34:41 -06:00
parent 8ae33a7ef3
commit a99e130b26
3 changed files with 9 additions and 6 deletions

View File

@ -391,10 +391,11 @@ 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
self.assertEqual( with pytest.deprecated_call():
font["glyf"].getPhantomPoints(".notdef", font, 0), self.assertEqual(
[(0, 0), (100, 0), (0, 0), (0, -1000)], font["glyf"].getPhantomPoints(".notdef", font, 0),
) [(0, 0), (100, 0), (0, 0), (0, -1000)],
)
class GlyphTest: class GlyphTest:

View File

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

View File

@ -51,7 +51,8 @@ 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
return list(varfont["glyf"].getCoordinatesAndControls(glyphname, varfont)[0]) with pytest.deprecated_call():
return list(varfont["glyf"].getCoordinatesAndControls(glyphname, varfont)[0])
class InstantiateGvarTest(object): class InstantiateGvarTest(object):