25 Commits

Author SHA1 Message Date
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