Skip to content

Commit

Permalink
Merge pull request #1836 from googlefonts/squash-warning
Browse files Browse the repository at this point in the history
Make sure to aclose the backend to avoid a warning
  • Loading branch information
justvanrossum authored Dec 4, 2024
2 parents 9bce849 + 2980f2b commit 2560047
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions test-py/test_backends_workflow.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import pathlib
from contextlib import aclosing

from fontra.backends import getFileSystemBackend

Expand All @@ -9,12 +10,13 @@
async def test_workflow_backend():
backend = getFileSystemBackend(workflowPath)

glyphMap = await backend.getGlyphMap()
async with aclosing(backend):
glyphMap = await backend.getGlyphMap()

assert {"A": [65, 97], "B": [66, 98]} == glyphMap
assert {"A": [65, 97], "B": [66, 98]} == glyphMap

glyph = await backend.getGlyph("A")
assert glyph is not None
glyph = await backend.getGlyph("A")
assert glyph is not None

glyph = await backend.getGlyph("C")
assert glyph is None
glyph = await backend.getGlyph("C")
assert glyph is None

0 comments on commit 2560047

Please sign in to comment.