Skip to content

Commit

Permalink
Use pytest as test runner
Browse files Browse the repository at this point in the history
  • Loading branch information
miguelgrinberg committed Jul 2, 2020
1 parent 5b946a0 commit dcea3a0
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 34 deletions.
12 changes: 6 additions & 6 deletions engineio/async_drivers/sanic.py
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
import sys
from urllib.parse import urlsplit

from sanic.response import HTTPResponse
try:
try: # pragma: no cover
from sanic.response import HTTPResponse
from sanic.websocket import WebSocketProtocol
except ImportError:
# the installed version of sanic does not have websocket support
HTTPResponse = None
WebSocketProtocol = None
import six


def create_route(app, engineio_server, engineio_endpoint):
def create_route(app, engineio_server, engineio_endpoint): # pragma: no cover
"""This function sets up the engine.io endpoint as a route for the
application.
Expand All @@ -26,7 +26,7 @@ def create_route(app, engineio_server, engineio_endpoint):
pass


def translate_request(request):
def translate_request(request): # pragma: no cover
"""This function takes the arguments passed to the request handler and
uses them to generate a WSGI compatible environ dictionary.
"""
Expand Down Expand Up @@ -89,7 +89,7 @@ async def read(self, length=None):
return environ


def make_response(status, headers, payload, environ):
def make_response(status, headers, payload, environ): # pragma: no cover
"""This function generates an appropriate response object for this async
mode.
"""
Expand Down
32 changes: 4 additions & 28 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
[tox]
envlist=flake8,py35,py36,py37,pypy,pypy3,docs,coverage
envlist=flake8,py35,py36,py37,pypy3,docs
skip_missing_interpreters=True

[testenv]
commands=
coverage run --branch --include="engineio/*" setup.py test
coverage report --show-missing
coverage erase
pytest -p no:logging --cov=engineio --cov-branch --cov-report=term-missing
deps=
coverage
pytest
pytest-cov
mock
eventlet
aiohttp
Expand All @@ -20,27 +19,10 @@ basepython =
py35: python3.5
py36: python3.6
py37: python3.7
pypy: pypy
pypy3: pypy3
coverage: python3.7
docs: python3.7

[testenv:py27]
deps=
coverage
mock
eventlet
requests
websocket-client

[testenv:pypy]
deps=
coverage
mock
eventlet
requests
websocket-client

[testenv:pypy3]

[testenv:flake8]
Expand All @@ -58,9 +40,3 @@ whitelist_externals=
make
commands=
make html

[testenv:coverage]
commands=
coverage run --branch --source=engineio setup.py test
coverage html
coverage erase

0 comments on commit dcea3a0

Please sign in to comment.