Skip to content

Commit

Permalink
Merge pull request #17 from sarnold/docstrings
Browse files Browse the repository at this point in the history
docstring and test fixes
  • Loading branch information
sarnold authored Aug 17, 2023
2 parents 84e7838 + 2aa9e9f commit 4cd9a54
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/coverage.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:

- name: Generate coverage
run: |
tox -e coverage,py37,py311
tox -e coverage,py36,py311
- name: Code Coverage Summary Report (data)
uses: irongut/CodeCoverageSummary@v1.3.0
Expand Down
2 changes: 0 additions & 2 deletions MANIFEST.in
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,3 @@ graft tests
graft docs

include tox.ini README.rst .env.* Procfile*

global-exclude *~ *.py[cod]
11 changes: 6 additions & 5 deletions pyserv/wsgi.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@

def wsgi_init(wapp, port, validate=True):
"""
Init wsgi server for handoff; init logging and simple_server classes.
Init wsgi server for handler handoff; init logging and simple_server
classes.
:param iface: initialized listen interface
:param wapp: initialized WSGI app to run
:param port: initialized listen port
:return wsgi_handler: wsgi handle, eg, wsgid.serve_forever()
"""
Expand All @@ -28,11 +29,11 @@ def wsgi_init(wapp, port, validate=True):

def wsgi_run(app=demo_app, port=PORT): # pragma: no cover
"""
Run in foreground command wrapper for console entry point;
Run in foreground command wrapper for WSGI console entry point;
init logging and server, run the server, stop the server.
:param iface: server listen interface
:param port: server listen port
:param app: WSGI app (defaults to ``demo_app`` if not provided)
:param port: WSGI server listen port
"""
wsgid = wsgi_init(app, port, True)
logging.info('Serving %s on port %s', DOCROOT, port)
Expand Down
9 changes: 9 additions & 0 deletions tests/test_serv.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,15 @@ def test_get_server_wsgi_attrs():
assert hasattr(serv_thread, 'stop')


def test_get_server_wsgi_props():
"""Test GetServer attrs"""

serv_thread = GetServerWSGI(demo_app, wport, False, True)
assert isinstance(serv_thread, GetServerWSGI)
assert hasattr(serv_thread, 'start')
assert hasattr(serv_thread, 'stop')


def test_serv_init():
"""Test serv_init wrapper"""

Expand Down
4 changes: 3 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
[tox]
envlist = py3{7,9,10,11}-{linux,macos,windows},coverage
envlist = py3{6,7,9,10,11}-{linux,macos,windows},coverage
skip_missing_interpreters = true
isolated_build = true
skipsdist = true

[gh-actions]
python =
3.6: py36
3.7: py37
3.9: py39
3.10: py310
Expand Down Expand Up @@ -81,6 +82,7 @@ commands =
coverage xml

depends =
py36
py37
py39
py310
Expand Down

0 comments on commit 4cd9a54

Please sign in to comment.