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,10 +391,11 @@ class GlyfTableTest(unittest.TestCase):
font["hmtx"].metrics = {".notdef": (100, 0)}
font["head"] = newTable("head")
font["head"].unitsPerEm = 1000
self.assertEqual(
font["glyf"].getPhantomPoints(".notdef", font, 0),
[(0, 0), (100, 0), (0, 0), (0, -1000)],
)
with pytest.deprecated_call():
self.assertEqual(
font["glyf"].getPhantomPoints(".notdef", font, 0),
[(0, 0), (100, 0), (0, 0), (0, -1000)],
)
class GlyphTest:

View File

@ -144,7 +144,8 @@ class TTGlyphSetTest(object):
assert list(glyphset.keys()) == [".notdef", "I"]
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

View File

@ -51,7 +51,8 @@ def fvarAxes():
def _get_coordinates(varfont, glyphname):
# converts GlyphCoordinates to a list of (x, y) tuples, so that pytest's
# 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):