- travis_retry pip install codecov virtualenv
# Create a separate no-dependencies virtualenv to make sure all imports
# of optional-dependencies are guarded.
- - virtualenv ./nodeps
- - ./nodeps/bin/python -VV
- - ./nodeps/bin/python setup.py install
+ - virtualenv /tmp/nodeps
+ - /tmp/nodeps/bin/python -VV
+ - /tmp/nodeps/bin/python setup.py install
- curl-config --version; pip freeze
script:
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --resolver=tornado.platform.twisted.TwistedResolver; fi
- if [[ $TRAVIS_PYTHON_VERSION == 2* ]]; then python $TARGET --ioloop=tornado.ioloop.PollIOLoop --ioloop_time_monotonic; fi
#- if [[ $TRAVIS_PYTHON_VERSION != pypy* ]]; then python $TARGET --resolver=tornado.platform.caresresolver.CaresResolver; fi
- - if [[ $TRAVIS_PYTHON_VERSION != 'pypy3' ]]; then ../nodeps/bin/python -m tornado.test.runtests; fi
+ - if [[ $TRAVIS_PYTHON_VERSION != 'pypy3' ]]; then /tmp/nodeps/bin/python -m tornado.test.runtests; fi
# make coverage reports for Codecov to find
- if [[ "$RUN_COVERAGE" == 1 ]]; then coverage xml; fi
- export TORNADO_EXTENSION=0
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-out && sphinx-build -E -n -W -b html . sphinx-out; fi
- if [[ $TRAVIS_PYTHON_VERSION == 3.6 ]]; then cd ../docs && mkdir sphinx-doctest-out && sphinx-build -E -n -b doctest . sphinx-out; fi
- - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then flake8; fi
+ - if [[ $TRAVIS_PYTHON_VERSION == '3.6' ]]; then cd .. && flake8; fi
after_success:
# call codecov from project root
# self.current_user in prepare instead.
user_id = self.get_secure_cookie("blogdemo_user")
if user_id:
- self.current_user = await self.queryone("SELECT * FROM authors WHERE id = %s", int(user_id))
+ self.current_user = await self.queryone("SELECT * FROM authors WHERE id = %s",
+ int(user_id))
async def any_author_exists(self):
return bool(await self.query("SELECT * FROM authors LIMIT 1"))
A Lock can be used as an async context manager with the ``async
with`` statement:
- >>> from tornado import gen, locks
+ >>> from tornado import locks
>>> lock = locks.Lock()
>>>
>>> async def f():
Newly-set cookies are not immediately visible via `get_cookie`;
they are not present until the next request.
-
+
expires may be a numeric timestamp as returned by `time.time`,
- a time tuple as returned by `time.gmtime`, or a
+ a time tuple as returned by `time.gmtime`, or a
`datetime.datetime` object.
Additional keyword arguments are set on the cookies.Morsel
from tornado import gen, httpclient, httputil
from tornado.ioloop import IOLoop, PeriodicCallback
from tornado.iostream import StreamClosedError
-from tornado.log import gen_log, app_log
+from tornado.log import gen_log
from tornado import simple_httpclient
from tornado.queues import Queue
from tornado.tcpclient import TCPClient