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.
This commit is contained in:
parent
0ab515b39e
commit
87894641c0
@ -37,7 +37,6 @@ license_file = LICENSE
|
|||||||
minversion = 3.0
|
minversion = 3.0
|
||||||
testpaths =
|
testpaths =
|
||||||
Tests
|
Tests
|
||||||
fontTools
|
|
||||||
python_files =
|
python_files =
|
||||||
*_test.py
|
*_test.py
|
||||||
python_classes =
|
python_classes =
|
||||||
|
4
tox.ini
4
tox.ini
@ -15,8 +15,8 @@ extras =
|
|||||||
!nolxml: lxml
|
!nolxml: lxml
|
||||||
commands =
|
commands =
|
||||||
# test with or without coverage, passing extra positonal args to pytest
|
# test with or without coverage, passing extra positonal args to pytest
|
||||||
cov: coverage run --parallel-mode -m pytest {posargs}
|
cov: coverage run --parallel-mode -m pytest {posargs:Tests fontTools}
|
||||||
!cov: pytest {posargs}
|
!cov: pytest {posargs:Tests fontTools}
|
||||||
|
|
||||||
[testenv:htmlcov]
|
[testenv:htmlcov]
|
||||||
deps =
|
deps =
|
||||||
|
Loading…
x
Reference in New Issue
Block a user