[Tests] Do not require fonttools command to be available

I typically run tests like:

$ python setup.py build_ext -i && PYTHONPATH=Lib pytest

Previously, this particular test and only this, required
that a `pip install -e .` has had happened. Not anymore.
This commit is contained in:
Behdad Esfahbod 2024-08-20 10:47:59 -06:00
parent 0c2652011e
commit ecd2d8e559

View File

@ -2,7 +2,6 @@ import contextlib
import logging import logging
import os import os
from pathlib import Path from pathlib import Path
from subprocess import run
from typing import List, Optional, Tuple from typing import List, Optional, Tuple
import pytest import pytest
@ -28,18 +27,17 @@ def test_main(tmpdir: Path):
input = tmpdir / "in.ttf" input = tmpdir / "in.ttf"
fb.save(str(input)) fb.save(str(input))
output = tmpdir / "out.ttf" output = tmpdir / "out.ttf"
run( args = [
[ "--gpos-compression-level",
"fonttools", "5",
"otlLib.optimize", str(input),
"--gpos-compression-level", "-o",
"5", str(output),
str(input), ]
"-o", from fontTools.otlLib.optimize import main
str(output),
], ret = main(args)
check=True, assert ret in (0, None)
)
assert output.exists() assert output.exists()