cu2qu.test: load test package data using pkg_resources
The test suite is installed as a sub-package, so the test data must also be installed along with it. The `__file__` attribute can be missing when importing a zipped package, so we load test files with `pkg_resources.resource_filename()`.
This commit is contained in:
parent
5e8f036edd
commit
4fb661f01a
@ -3,9 +3,9 @@ try:
|
||||
from ufoLib.glifLib import GlyphSet
|
||||
except ImportError:
|
||||
from robofab.glifLib import GlyphSet
|
||||
import pkg_resources
|
||||
|
||||
DATADIR = os.path.join(
|
||||
os.path.abspath(os.path.dirname(os.path.realpath(__file__))), 'data')
|
||||
DATADIR = pkg_resources.resource_filename('cu2qu.test', 'data')
|
||||
CUBIC_GLYPHS = GlyphSet(os.path.join(DATADIR, 'cubic'))
|
||||
QUAD_GLYPHS = GlyphSet(os.path.join(DATADIR, 'quadratic'))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user