]>
git.ipfire.org Git - thirdparty/tornado.git/blob - tox.ini
1 # Tox (https://tox.readthedocs.io) is a tool for running tests
2 # in multiple virtualenvs. This configuration file will run the tornado
3 # test suite on all supported python versions. To use it, "pip install tox"
4 # and then run "tox" from this directory.
6 # This configuration requires tox 1.8 or higher.
9 # When building pycurl on my macports-based setup, I need to either set the
10 # environment variable ARCHFLAGS='-arch x86_64' or use
11 # 'port install curl +universal' to get both 32- and 64-bit versions of
15 # Basic configurations: Run the tests for each python version.
16 py38
-full
,py39
-full
,py310
-full
,py311
-full
,pypy3
-full
18 # Build and test the docs with sphinx.
33 # In theory, it doesn't matter which python version is used here.
34 # In practice, things like changes to the ast module can alter
35 # the outputs of the tools (especially where exactly the
36 # linter warning-suppression comments go), so we specify a
37 # python version for these builds.
38 # These versions must be synced with the versions in .github/workflows/test.yml
46 docs
: -r
{toxinidir
}/requirements.txt
47 lint
: -r
{toxinidir
}/requirements.txt
50 # Treat the extension as mandatory in testing (but not on pypy)
51 {py3,py38,py39,py310,py311,py312}: TORNADO_EXTENSION=1
52 # CI workers are often overloaded and can cause our tests to exceed
53 # the default timeout of 5s.
55 # Treat warnings as errors by default. We have a whitelist of
56 # allowed warnings in runtests.py, but we want to be strict
57 # about any import-time warnings before that setup code is
58 # reached. Note that syntax warnings are only reported in
59 # -opt builds because regular builds reuse pycs created
60 # during sdist installation (and it doesn't seem to be
61 # possible to set environment variables during that phase of
63 {py3,py38,py39,py310,py311,pypy3}: PYTHONWARNINGS=error:::tornado
64 # Warn if we try to open a file with an unspecified encoding.
65 # (New in python 3.10, becomes obsolete when utf8 becomes the
67 PYTHONWARNDEFAULTENCODING=1
69 # Allow shell commands in tests
70 allowlist_externals = sh
73 # All non-comment lines but the last must end in a backslash.
74 # Tox filters line-by-line based on the environment name.
76 # py3*: -b turns on an extra warning when calling
77 # str(bytes), and -bb makes it an error.
78 python
-bb
-m tornado.test
{posargs
:}
79 # Python's optimized mode disables the assert statement, so
80 # run the tests in this mode to ensure we haven't fallen into
81 # the trap of relying on an assertion's side effects or using
82 # them for things that should be runtime errors.
83 full
: python
-O
-m tornado.test
84 # Note that httpclient_test is always run with both client
85 # implementations; this flag controls which client all the
87 full: python -m tornado.test --httpclient=tornado.curl_httpclient.CurlAsyncHTTPClient
88 full: python -m tornado.test --resolver=tornado.platform.caresresolver.CaresResolver
90 # python will import relative to the current working directory by default,
91 # so cd into the tox working directory to avoid picking up the working
92 # copy of the files (especially important for the speedups module).
93 changedir = {toxworkdir}
97 # For some reason the extension fails to load in this configuration,
98 # but it's not really needed for docs anyway.
99 setenv = TORNADO_EXTENSION=0
102 sphinx
-build
-q
-E
-n
-W
-b html .
{envtmpdir
}/html
103 # Run the doctests. No -W for doctests because that disallows tests
105 sphinx
-build
-q
-E
-n
-b doctest .
{envtmpdir
}/doctest
110 black
--check
--diff
{posargs
:tornado demos
}
111 # Many syscalls are defined differently on linux and windows,
112 # so we have to typecheck both.
113 mypy
--platform linux
{posargs
:tornado
}
114 mypy
--platform windows
{posargs
:tornado
}
115 changedir = {toxinidir}