Skip to content

Commit db5424c

Browse files
Complete test coverage (#654)
1 parent ef2eb77 commit db5424c

File tree

4 files changed

+4
-34
lines changed

4 files changed

+4
-34
lines changed

tests/check_tag.py

Lines changed: 0 additions & 17 deletions
This file was deleted.

tests/test_runserver_cleanup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ async def is_server_running() -> bool:
1818
text = await r.text()
1919
assert "hello, world" in text
2020
return True
21-
except OSError:
21+
except OSError: # pragma: no cover
2222
await asyncio.sleep(0.5)
23-
except asyncio.TimeoutError:
23+
except asyncio.TimeoutError: # pragma: no cover
2424
pass
25-
return False
25+
return False # pragma: no cover
2626

2727
proc = await asyncio.create_subprocess_exec(
2828
sys.executable, "-c", "from aiohttp_devtools.cli import runserver; runserver()", # same as `adev runserver`

tests/test_runserver_main.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
async def check_server_running(check_callback):
2222
port_open = False
2323
async with aiohttp.ClientSession(timeout=ClientTimeout(total=1)) as session:
24-
for i in range(50):
24+
for i in range(50): # pragma: no branch
2525
try:
2626
async with session.get('http://localhost:8000/'):
2727
pass

tests/test_runserver_watch.py

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -143,19 +143,6 @@ async def test_livereload_task_multiple(event_loop, mocker):
143143
mock_src_reload.assert_called_once_with(app)
144144

145145

146-
class FakeProcess:
147-
def __init__(self, is_alive=True, exitcode=1, pid=123):
148-
self._is_alive = is_alive
149-
self.exitcode = exitcode
150-
self.pid = pid
151-
152-
def is_alive(self):
153-
return self._is_alive
154-
155-
def join(self, wait):
156-
pass
157-
158-
159146
async def test_stop_process_dead(smart_caplog, mocker):
160147
mock_kill = mocker.patch('aiohttp_devtools.runserver.watch.os.kill')
161148
mocker.patch('aiohttp_devtools.runserver.watch.awatch')

0 commit comments

Comments
 (0)