fonttools/setup.cfg
Behdad Esfahbod 03d264756b
Test var model error (#2217)
* [varLib.models] Add test for modeling rounding error

Tests https://github.com/fonttools/fonttools/pull/2214

If you flip demo to True, it does a slower test and demos the new error as well
as the error the old code was producing (ie. rounding deltas post-modeling).

Indeed, the new error is always capped by 0.5 as expected, whereas the old one
was unbounded. Here's the worst-case error of the bad code:

...
240     0.42    4.8
...

240 is just the line number. 0.42 is new error. 4.8 is old error.

* turn test_modeling_error into a parametrized pytest test

Like the other test methods in the same module, all those whose name starts with 'test_' are automatically discovered and run by pytest which is our default test runner. So there is no need to call the test method itself in the top-level module scope. One simply runs the test via pytest. To execute this specific test method one can do 'pytest Tests/varLib/models_test.py::test_modeling_error'.

* use pytest markers to mark specific test as 'slow'

So that one can optionally deselect tests marked with specific marker by passing -m option (e.g. to deselect 'slow' tests, pytest -m 'not slow' ...).

https://docs.pytest.org/en/stable/mark.html#registering-marks
https://docs.pytest.org/en/stable/example/parametrize.html#set-marks-or-test-id-for-individual-parametrized-test

* [varLib/models_test] Comment out non-test code

Co-authored-by: Cosimo Lupo <clupo@google.com>
2022-08-15 10:30:45 -06:00

64 lines
1.3 KiB
INI

[bumpversion]
current_version = 4.35.1.dev0
commit = True
tag = False
tag_name = {new_version}
parse = (?P<major>\d+)\.(?P<minor>\d+)\.(?P<patch>\d+)(\.(?P<release>[a-z]+)(?P<dev>\d+))?
serialize =
{major}.{minor}.{patch}.{release}{dev}
{major}.{minor}.{patch}
[bumpversion:part:release]
optional_value = final
values =
dev
final
[bumpversion:part:dev]
[bumpversion:file:Lib/fontTools/__init__.py]
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"
[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
[sdist]
formats = zip
[metadata]
license_file = LICENSE
[tool:pytest]
minversion = 3.0
testpaths =
Tests
fontTools
python_files =
*_test.py
python_classes =
*Test
addopts =
-r a
--doctest-modules
--doctest-ignore-import-errors
--pyargs
doctest_optionflags =
ALLOW_UNICODE
ELLIPSIS
filterwarnings =
ignore:readPlist:DeprecationWarning:plistlib_test
ignore:writePlist:DeprecationWarning:plistlib_test
ignore:some_function:DeprecationWarning:fontTools.ufoLib.utils
ignore::DeprecationWarning:fontTools.varLib.designspace
markers =
slow: marks tests as slow (deselect with '-m "not slow"')
[tool:interrogate]
ignore-semiprivate = true
ignore-private = true
ignore-nested-functions = true
ignore-regex = ^(from|to)XML$,^(de)?compile$
ignore-module = true