This is useful to quickly add logging functionality to classes, and
to reduce boilerplate.
It adds a 'log' property to the class inheriting from it, which uses
logging.getLogger to get a logging.Logger (sigleton) object named after
<module>.<class> of self.
Can be useful for writing tests:
>>> with CapturingLogHandler(log, "WARNING") as captor:
... # do something with logging
>>> assert captor.match('some .* pattern')
The {posargs} are global for the current tox process, and we already use them to pass additional arguments to the pytest command in the default testenv, so we can't at the same time also use them to pass options to coverage.py.
The 'htmlcov' tox environment produces the combined coverage.py report, and store it in htmlcov/index.html; this is listed in the tox.ini 'envlist', so it is run by default at every 'tox' invocation, when no explicit env list is passed via either -e option or $TOXENV variable.
The options to `coverage html` are not much interesting anyway; it's much more useful being able to, e.g., run tox for specific tests matching a string or expression:
$ tox -- -k "feaLib"
When running tox locally during development, there's no need to also test python 3.5.
2.7 and 3.6 are enough, and the CI takes care of the others (3.4, 3.5, pypy, etc.).
The --pyargs option makes pytest try interpreting arguments as importable python package names, or if that fails treat them as normal filesystem paths.
Now running `pytest` command will automatically run all the tests in "Tests" folder, as well as the embedded doctests in the installed "fontTools" package.
This is in reply to a comment by Behdad in
fdbf066a8c
Gosh! This is the kind of thinko that doesn't happen with less dynamic languages...
Good one hour of debugging at TYPO Labs. Glad this one is fixed finally!
Fixes https://github.com/fonttools/fonttools/issues/888
Tolerance is set to .5 by default. Most designspaces never hit this since
for most, all deltas are integers anyway. Moreover, all such detas will
round to zero anyway.