42 Commits

Author SHA1 Message Date
Cosimo Lupo
f66425997f
Enable testing on Python 3.8 2020-03-12 18:31:41 +00:00
Cosimo Lupo
fd5ea97124
tox.ini: pin pytest==5.1.1 to workaround issue with caplog fixture on windows
https://ci.appveyor.com/project/fonttools/fonttools/builds/27126458/job/iomtsu4prflws4xu
2019-09-10 16:03:53 +02:00
Cosimo Lupo
421715b751
travis/appveyor: no longer run tests on python2.7 2019-08-02 11:56:28 +01:00
Cosimo Lupo
ab9472d3ab
tox.ini: use pytest-randomly to randomize test execution
https://github.com/pytest-dev/pytest-randomly
2019-06-11 13:25:27 +01:00
Cosimo Lupo
87894641c0 pytest 4.0 doesn't recognize module name if listed in 'testpaths'
'fontTools' is not a folder name, but the import name of the package
where we have some doctests to be discovered and run.

even though we have --pyargs option (which makes pytest first attempt
to treat any positional arguments as module import names), with the
latest pytest 4.0.0 our tests started to fail as if the new pytest
is evaluating the default 'testpaths' (as defined in setup.cfg, used
when no arguments are supplied to pytest) _before_ the --pyargs
option, and thus it thinks that 'fontTools' is a directory name
instead of a package name...

This a workaround. It also means that if one runs `pytest` without
arguments, only the tests inside `Tests` directory are going to be
run automatically, and not also the doctests inside fontTools package.

When running the test suite using tox, all tests are run, both
those in Tests folder and the doctests in fontTools.
2018-11-15 08:47:20 +00:00
Cosimo Lupo
7059296312
tox: 'twine check' already checks RST, don't need to do it again 2018-11-01 13:23:27 +00:00
Cosimo Lupo
39dd56f552
tox: add env to check package long_description using 'twine check' command
Restrucutred Text is very picky. 3.32.0 release process failed because of some broken rst.
I have to stop doing [skip ci] when I update the changelog... :(
2018-11-01 13:11:12 +00:00
Cosimo Lupo
88b6688fbd
tox: remove unnecessary 'nocov' factor
tox now allows to use exclamation mark to negate an environment factor.
2018-10-18 15:40:32 +01:00
Cosimo Lupo
b1093c8ac1
tox: add extras; allow to test with/without lxml
calling 'tox -e py37-cov-nolxml' will run tests without lxml,
using built-in ElementTree library
2018-10-18 15:40:32 +01:00
Cosimo Lupo
056bd7d967
[travis] use twine to upload to PyPI 2018-09-11 12:09:50 +02:00
Cosimo Lupo
553f23f1db
tox.ini: require at least tox >= 3.0 2018-07-25 19:14:25 +01:00
Cosimo Lupo
d79b2dd6c7
tox/appveyor: don't use TOXPYTHON env var to select basepython; write a pythonX.Y.bat wrapper instead 2018-07-25 19:03:05 +01:00
Cosimo Lupo
6105c41f34
tox.ini: add py37 env 2018-07-24 12:17:59 +01:00
Cosimo Lupo
189d158887 [travis/tox] check syntax of reStructuredText before release
I pushed a NEWS.rst with broken indentation, the PyPI page will
display plan text garbage.

Next time I'll use docutils and do `python setup.py check
--restructuredtext` before pushing a new tag.

Also, I forgot to update .travis.yml to build the dist packages
on python3.6 instead of 3.5 after I modified the tox.ini, so
the automatic release from Travis failed.

This time I had to use twine tool to upload the zip and whl
packages from my local machine to PyPI.

Sorry the mess...
2017-11-21 13:04:12 +01:00
Cosimo Lupo
943b63c7d2 [tox.ini] use python3.6 for testenv:htmlcov 2017-11-21 10:24:43 +01:00
Cosimo Lupo
e5e795ac9f
[tox] don't pass {posargs} to coverage in 'htmlcov' env
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"
2017-04-10 12:23:12 +01:00
Cosimo Lupo
41d5db5bbc
[tox] only test on py27 and py36 when running 'tox' without arguments
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.).
2017-04-10 11:42:09 +01:00
Cosimo Lupo
40a61de570
[tox.in] doctests are now run as part of the same pytest command 2017-04-10 11:32:17 +01:00
Cosimo Lupo
cc08ab1050
add munkres to requirements.txt to test varLib.interpolatable 2017-03-07 11:24:16 +00:00
Miguel Sousa
8212916aa4 [varLib tests] Test for interpolatable.py 2017-03-06 03:04:45 -08:00
Cosimo Lupo
223c39f77e
[tox] also run pytest --pyargs fontTools for embedded doctests 2017-01-17 22:14:16 +00:00
Cosimo Lupo
6a6efc7877
[tox] call pytest without --pyargs option
Previously, we were using --pyargs to make sure pytest would run the test suite against the installed package, because our tests
were embedded inside the package and hence importable.

Now that they are placed in an external folder, that option is not needed.
pytest without options will run all the test modules from the default test paths as defined in setup.cfg, i.e Tests/ folder.

The tests will be run against the installed fontTools in the current tox environment.

We also pass {posargs} in the 'htmlcov' tox env, to allow passing extra options after `tox -e htmlcov -- {posargs}` to the `coverage html` command.
2017-01-17 13:29:32 +00:00
Cosimo Lupo
522d826eca
tox.ini: require coverage>=4.3
Coverage 4.3 was released, it includes this patch:
https://bitbucket.org/ned/coveragepy/pull-requests/118/check-source-isdir-not-just-exists-there/diff
2016-12-31 13:34:12 +01:00
Cosimo Lupo
61ab1e7f6d
build sdist/wheel only once for both Github and PyPI
This makes sure we upload the same files to Github Releases and PyPI.

Currently we were building them twice, with the risk of different files
being uploaded to the two repositories.
2016-12-26 19:36:08 +00:00
Cosimo Lupo
17dab6b968
tox.ini: don't skip missing interpreters as it may hide CI configuration issues 2016-12-26 18:39:38 +00:00
Cosimo Lupo
454f60f7b6
tox.ini: use coverage.py instead of pytest-cov; run in --parallel-mode; use codecov instead of coveralls
We no longer use coverage.py through the pytest-cov plugin, as it does not
support --parallel-mode (or at least I wasn't able to figure it out).
We run pytest through `coverage run -m pytest` instead, which does the same
as `pytest --cov`.

Running `tox` locally by default will now run pytest and coverage on 2.7, 3.5 and 3.6; it will then
combine coverage data from all three, and finally generate a coverage report in htmlcov/index.html

We need tp temporarily install coverage.py from the mercurial repo instead of the latest release
because we require a patch that is not available yet with coverage 4.2:
https://bitbucket.org/ned/coveragepy/pull-requests/118/check-source-isdir-not-just-exists-there/diff

Finally, I replaced Coveralls with Codecov, as the latter is better designed and also supports Appveyor.
2016-12-26 18:32:26 +00:00
Cosimo Lupo
667e291501
tox.ini: add py36 to env list
Running `tox` locally will run tests on 2.7, 3.5 and 3.6, by default; in any of these is not found, it will be skipped.
2016-12-25 18:08:00 +00:00
Cosimo Lupo
907af836c0 [tox] add 'coverage' toxenv to make local html coverage report
This is useful if one wants to run coverage tests locally, and get a nice HTML report while one is writing tests.

Just run:

$ tox -e coverage -- {optional pytest arguments}

And you get a "htmlcov/index.html" to view in your browser.
2016-10-14 18:35:33 +01:00
Cosimo Lupo
c8901bf940 [tox] remove unneeded print statements
This information is already displayed by pytest in the header of the test run output
2016-10-14 18:35:33 +01:00
Cosimo Lupo
ce313520cf [tox] use --pyargs fontTools to run tests against package installed in tox env instead of source dir
This will ensure we don't forget to add any data files to the MANIFEST.in (which means test data is not available to the inlined tests).

{posargs} allows to pass extra arguments to the test runner, when runing `tox -- {posargs}` from the command line.

With `--pyargs` option, pytest tries to interpret arguments as python package/module names, and if import fails as regular filesystem paths.
2016-10-14 18:35:33 +01:00
Cosimo Lupo
1422170d22 move pytest default config to setup.cfg so it's available for python setup.py test as well as tox 2016-09-27 13:21:47 +01:00
Cosimo Lupo
6d02c79557 tox.ini: add {posargs} to pass additional command line arguments to py.test
When invoking the tox command, the arguments after the -- will be passed on to the py.test command:

For example:
$ tox -- -x -s -k 'test_something or test_other'

http://tox.readthedocs.io/en/1.0/example/general.html#interactively-passing-positional-arguments
2016-08-19 11:36:39 +01:00
Cosimo Lupo
c289580089 tox.ini: only include py27 and py35 in default 'envlist''
When running `tox` command without specifying any `-e` option, or when no $TOXENV environment variable is specified, the 'envlist' in tox.ini file determines the list of environment tox will operate on.

http://tox.readthedocs.io/en/latest/config.html#confval-envlist=CSV

I chose Python 2.7 and 3.5 because I assume they are the versions that other fonttols developers run their tests on locally, before pushing and let the CI run the tests on the rest of the pythons.
2016-08-19 11:31:07 +01:00
Cosimo Lupo
4d7cd66ebc tox.ini: drop py33 testenv 2016-08-06 19:46:22 +01:00
Cosimo Lupo
624fe3f625 tox.ini: configure coveralls 2016-04-11 01:11:01 +01:00
Cosimo Lupo
a37dc9f186 tox.ini: use {envpython} substituion for path to the virtual Python interpreter 2016-04-11 01:11:01 +01:00
Cosimo Lupo
5f8d0f8ecc tox.ini: I forgot that we still support python 3.3 (sorry)
I hope not for long, though.
2016-04-10 21:06:55 +01:00
Cosimo Lupo
7223267328 tox.ini: specify 'basepython' (with TOXPYTHON override); print python version and arch; call python -m pip to work around Appveyor-installed pip 2016-04-10 19:17:36 +01:00
Cosimo Lupo
464057a4db [tox.ini] set *Test pattern for pytest's python_classes
The glob pattern determines which classes are considered for test collection by pytest.
We already follow this pattern for the unittest.TestCase derived subclasses
(which are collected regardless of this option).
2016-02-07 17:42:55 +00:00
Cosimo Lupo
118045abf0 [tox.ini] tell pytest to only collect tests from *_test.py modules; set pytest 'minversion' to 2.8
the glob pattern will restricts the search only for pytest's kind of tests; it has no effect on methods of unittest.TestCase derived class, since pytest still uses unittest's own collection framework to collect those.

The 'minversion' is required to support some of the latest advanced features.
The current py.test is 2.8.7. You can update it with `pip install --upgrade pytest`.
2016-02-06 20:59:00 +00:00
Cosimo Lupo
568b4e9129 [tox.ini] use 'testpaths' to tell py.test where to look for tests
this to avoid picking up undesired tests by accident when running `py.test` command without specific dirs or files
2016-02-06 17:12:01 +00:00
Cosimo Lupo
12e5007b1d tox.ini: configure tox test environment; set up py.test to discover both doctest and unittest tests 2015-12-12 18:11:59 +00:00