Boost test speed by pytest-xdist
This commit is contained in:
committed by
Jeong YunWon
parent
72254a7af9
commit
a8827a5d95
@@ -9,7 +9,7 @@ from sanic import Sanic
|
||||
from sanic.exceptions import ServerError
|
||||
from sanic.response import json, text
|
||||
from sanic.request import DEFAULT_HTTP_CONTENT_TYPE
|
||||
from sanic.testing import HOST, PORT
|
||||
from sanic.testing import HOST
|
||||
|
||||
|
||||
# ------------------------------------------------------------ #
|
||||
@@ -338,7 +338,7 @@ def test_url_attributes_no_ssl(path, query, expected_url):
|
||||
app.add_route(handler, path)
|
||||
|
||||
request, response = app.test_client.get(path + '?{}'.format(query))
|
||||
assert request.url == expected_url.format(HOST, PORT)
|
||||
assert request.url == expected_url.format(HOST, app.test_port)
|
||||
|
||||
parsed = urlparse(request.url)
|
||||
|
||||
@@ -369,9 +369,9 @@ def test_url_attributes_with_ssl(path, query, expected_url):
|
||||
app.add_route(handler, path)
|
||||
|
||||
request, response = app.test_client.get(
|
||||
'https://{}:{}'.format(HOST, PORT) + path + '?{}'.format(query),
|
||||
'https://{}:{}'.format(HOST, app.test_port) + path + '?{}'.format(query),
|
||||
server_kwargs={'ssl': context})
|
||||
assert request.url == expected_url.format(HOST, PORT)
|
||||
assert request.url == expected_url.format(HOST, app.test_port)
|
||||
|
||||
parsed = urlparse(request.url)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user