Cosimo Lupo
d017d2b173
use pytest importorskip to skip modules that depend on extra requirements
...
this should allow to run the basic test suite against the dependency-less core of fonttools library
2023-05-24 16:26:48 +01:00
Harry Dalton
70ca6dec9b
Identify the culprit glif in read errors with a loose backport of PEP678
...
This commit annotates errors from GlyphSet.readGlyph() with the details
of the glyph that originated them (e.g. name, path to glif). This is
implemented with a loose backport of PEP678, to avoid adding a wrapper
error that would be less specific and would break API compatibility.
In addition, this commit adds a test to ensure that the new details are
present (specifically, in the case of parsing invalid XML).
2023-03-14 15:58:18 +00:00
Harry Dalton
1f3380300b
Wrap XML library exceptions with glifLib types when parsing glifs
...
This allows dependent projects to catch errors parsing glifs without
requiring logic to account for which XML library fonttools is using
internally (e.g. for implementing fonttools/ufoLib2#264 ).
This commit also adds tests to ensure that the exception we expose when
glifs have invalid syntax remains stable across future releases.
2023-03-09 16:11:32 +00:00
Nikolaus Waxweiler
d584daa8fd
Blacken code
2022-12-13 11:26:36 +00:00
Nikolaus Waxweiler
128326cd50
Expand reserved names and fix illegal characters
2022-01-18 10:13:22 +00:00
Nikolaus Waxweiler
a7e4d86540
Use a set for file names for clash checking
2021-10-07 12:03:47 +01:00
Khaled Hosny
232b2ccbc4
Move the rest of py23 module to textTools
...
Change all imports to use textTools module, except the test_py23.py test
which is kept until we decide to remove the module (if ever).
2021-08-20 01:29:45 +02:00
Nikolaus Waxweiler
8ca141852d
UFOReader: always expect contents.plist
2020-11-23 14:34:16 +00:00
Nikolaus Waxweiler
8d2a3ae6d2
Add expectContentsFile parameter to GlyphSet
...
For use when reading existing UFOs, to comply with the specification stating that a contents.plist file must exist in a glyph set.
Closes https://github.com/fonttools/fonttools/issues/2111 .
2020-11-23 13:57:32 +00:00
Nikolaus Waxweiler
04e1269b41
[glifLib] Hard-require x and y coordinates
2020-10-03 12:43:28 +01:00
Cosimo Lupo
dc2ee4e082
glifLib_test: check case insensitive filenames are unique
...
tests for https://github.com/fonttools/fonttools/pull/2002
2020-07-03 11:37:17 +01:00
Tom Archer
0e04e039cf
Add more glyphs to test group to prove order is preserved
2020-05-22 10:41:10 +01:00
Tom Archer
6f72429150
Small changes
2020-05-22 09:55:16 +01:00
Tom Archer
b88f717885
Get test working that shows duplicates are removed
2020-05-22 09:53:40 +01:00
Cosimo Lupo
82faf2addc
ufoLib_test: fix test on pypy3
...
shutil.rmtree doesn't like pathlib Paths on pypy3 for some reasosn
https://travis-ci.org/github/fonttools/fonttools/jobs/684236676#L592
2020-05-07 16:53:39 +01:00
Cosimo Lupo
b617ac798e
glifLib_test: add tests for GLIF format version as tuple
2020-05-07 16:53:38 +01:00
Cosimo Lupo
b82abbc10e
ufoLib_test: add tests for new formatVersion as tuple
2020-05-07 16:53:38 +01:00
Cosimo Lupo
70c3eccb4e
glifLib_test: test xml containing <!-- comment -->
2019-12-16 12:01:40 +00:00
Jens Kutilek
6c3edaded2
ufoLib groupnames conversion 2 → 3 ( #1762 )
...
* If a group name is the same as a glyph name, it cannot be a kerning group name
* Add test
2019-11-22 09:51:35 +01:00
Nikolaus Waxweiler
d36204bf32
Make the original testRemoveDefaultLayer test run
2019-09-14 21:59:39 +01:00
Nikolaus Waxweiler
562052bb86
Don't allow byte layer names
2019-09-14 21:55:46 +01:00
Nikolaus Waxweiler
0f5b6e2e83
Reduce use of py23
2019-09-13 18:27:05 +01:00
Nikolaus Waxweiler
14bb52a616
Upgrade Tests/ufoLib to Python 3.6+ syntax
2019-09-13 18:27:05 +01:00
Nikolaus Waxweiler
01328213c7
Remove __future__ imports
2019-08-09 12:20:13 +01:00
Cosimo Lupo
8081bf57fa
etree/plistlib/glifLib: using (default) single quotes in XML_DECLARATION
...
https://github.com/fonttools/fonttools/pull/1335#issuecomment-431118568
2018-10-18 19:49:52 +01:00
Cosimo Lupo
2cc1f418c7
rename Tests/ufoLib/test_*.py to Tests/ufoLib/*_test.py
...
for constency with the rest of fontTools tests.
Also, in setup.cfg we tell pytest to only search for modules named like these
2018-10-17 17:50:06 +01:00
Cosimo Lupo
0cef799a08
move test_{etree,plistlib}.py to misc/{etree,plistlib}_test.py
2018-10-17 17:46:37 +01:00
Cosimo Lupo
176b5f763d
change 'import ufoLib' to 'import fontTools.ufoLib'
2018-10-17 17:43:28 +01:00
Cosimo Lupo
ee94843cdd
move tests to Tests/ufoLib
2018-10-17 17:06:12 +01:00