Skip to content

Commit

Permalink
Merge 6b72bfb into 1a620cd
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-tyler committed May 21, 2019
2 parents 1a620cd + 6b72bfb commit 084fe52
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 7 deletions.
6 changes: 6 additions & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[settings]
multi_line_output=3
include_trailing_comma=True
force_grid_wrap=0
use_parentheses=True
line_length=88
6 changes: 3 additions & 3 deletions hug/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
from falcon import *

from hug import (
authentication,
defaults,
directives,
exceptions,
format,
Expand Down Expand Up @@ -89,11 +89,11 @@
)
from hug.types import create as type

# The following imports must be imported last for defaults to have access to all modules
# The following imports must be imported last; in particular, defaults to have access to all modules
from hug import authentication #isort:skip
from hug import development_runner # isort:skip
from hug import defaults # isort:skip


try: # pragma: no cover - defaulting to uvloop if it is installed
import uvloop
import asyncio
Expand Down
10 changes: 6 additions & 4 deletions tests/test_full_request.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,13 @@ def post(body, response):
"""


@pytest.mark.skipif(platform.python_implementation() == "PyPy", reason="Can't run hug CLI from travis PyPy")
@pytest.mark.skipif(
platform.python_implementation() == "PyPy", reason="Can't run hug CLI from travis PyPy"
)
def test_hug_post(tmp_path):
hug_test_file = (tmp_path / "hug_postable.py")
hug_test_file = tmp_path / "hug_postable.py"
hug_test_file.write_text(TEST_HUG_API)
hug_server = Popen(['hug', '-f', str(hug_test_file), '-p', '3000'])
hug_server = Popen(["hug", "-f", str(hug_test_file), "-p", "3000"])
time.sleep(5)
requests.post('http://127.0.0.1:3000/test', {'data': 'here'})
requests.post("http://127.0.0.1:3000/test", {"data": "here"})
hug_server.kill()
8 changes: 8 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,14 @@ deps=
whitelist_externals=flake8
commands=bandit -r hug/ -ll

[testenv:py37-isort]
deps=
-rrequirements/build_style_tools.txt
marshmallow >=3.0.0rc5

whitelist_externals=flake8
commands=isort -c --diff --recursive hug

[testenv:pywin]
deps =-rrequirements/build_windows.txt
basepython = {env:PYTHON:}\python.exe
Expand Down

0 comments on commit 084fe52

Please sign in to comment.