Merge pull request #45 from anthrotype/testdata

move all test data inside the inlined ufoLib/test modules, and install them
This commit is contained in:
Adrien Tétar 2016-10-17 20:53:02 +02:00 committed by GitHub
commit 8a1075cfe4
45 changed files with 14 additions and 19 deletions

View File

@ -12,9 +12,8 @@ except NameError:
def getDemoFontPath():
"""Return the path to Data/DemoFont.ufo/."""
import ufoLib
root = os.path.dirname(os.path.dirname(os.path.dirname(ufoLib.__file__)))
return os.path.join(root, "Data", "DemoFont.ufo")
testdata = os.path.join(os.path.dirname(__file__), "testdata")
return os.path.join(testdata, "DemoFont.ufo")
def getDemoFontGlyphSetPath():

View File

@ -4139,12 +4139,8 @@ class UFO3WriteLayersTestCase(unittest.TestCase):
class UFO3ReadDataTestCase(unittest.TestCase):
def getFontPath(self):
import ufoLib
path = os.path.dirname(ufoLib.__file__)
path = os.path.dirname(path)
path = os.path.dirname(path)
path = os.path.join(path, "TestData", "UFO3-Read Data.ufo")
return path
testdata = os.path.join(os.path.dirname(__file__), "testdata")
return os.path.join(testdata, "UFO3-Read Data.ufo")
def testUFOReaderDataDirectoryListing(self):
reader = UFOReader(self.getFontPath())

View File

@ -30,12 +30,8 @@ class ConversionFunctionsTestCase(unittest.TestCase):
shutil.rmtree(path)
def getFontPath(self, fileName):
import ufoLib
path = os.path.dirname(ufoLib.__file__)
path = os.path.dirname(path)
path = os.path.dirname(path)
path = os.path.join(path, "TestData", fileName)
return path
testdata = os.path.join(os.path.dirname(__file__), "testdata")
return os.path.join(testdata, fileName)
def compareFileStructures(self, path1, path2, expectedInfoData, testFeatures):
# result

View File

@ -3,7 +3,6 @@ include README.md notes.txt LICENSE.txt
include Documentation/Makefile
recursive-include Documentation *.py *.rst
recursive-include Data *.plist *.glif
recursive-include TestData *.plist *.glif *.fea *.txt
recursive-include Lib/ufoLib/test/testdata *.plist *.glif *.fea *.txt
include requirements.txt tox.ini

View File

@ -7,6 +7,9 @@ formats = zip
[aliases]
test = pytest
[metadata]
license_file = LICENSE.txt
[tool:pytest]
minversion = 3.0.2
testpaths =

View File

@ -29,6 +29,7 @@ setup_params = dict(
long_description=long_description,
package_dir={'': 'Lib'},
packages=find_packages('Lib'),
include_package_data=True,
setup_requires=pytest_runner + wheel,
tests_require=[
'pytest>=3.0.2',

View File

@ -11,5 +11,6 @@ deps =
pytest
-rrequirements.txt
commands =
# pass to pytest any extra positional arguments after `tox -- ...`
pytest {posargs}
# run the test suite against the package installed inside tox env.
# any extra positional arguments after `tox -- ...` are passed on to pytest
pytest {posargs:--pyargs ufoLib}