summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars-Dominik Braun <lars@6xq.net>2019-01-04 12:41:28 +0100
committerLars-Dominik Braun <lars@6xq.net>2019-01-04 12:41:28 +0100
commitc88d4320aad98530800a371292f7c1e3e5d92934 (patch)
tree1cae70afb521280c32b4a2b9b556688e7c35fd0f
parent9bfb369f0bf05d8f104e39b6c93d95af37fd7739 (diff)
downloadcrocoite-c88d4320aad98530800a371292f7c1e3e5d92934.tar.gz
crocoite-c88d4320aad98530800a371292f7c1e3e5d92934.tar.bz2
crocoite-c88d4320aad98530800a371292f7c1e3e5d92934.zip
coverage: Ignore a few unreachable statements
-rw-r--r--crocoite/behavior.py12
-rw-r--r--crocoite/test_behavior.py2
2 files changed, 7 insertions, 7 deletions
diff --git a/crocoite/behavior.py b/crocoite/behavior.py
index dcab33a..dff1439 100644
--- a/crocoite/behavior.py
+++ b/crocoite/behavior.py
@@ -95,17 +95,17 @@ class Behavior:
""" After loading the page started """
# this is a dirty hack to make this function an async generator
return
- yield
+ yield # pragma: no cover
async def onstop (self):
""" Before page loading is stopped """
return
- yield
+ yield # pragma: no cover
async def onfinish (self):
""" After the site has stopped loading """
return
- yield
+ yield # pragma: no cover
class JsOnload (Behavior):
""" Execute JavaScript on page load """
@@ -154,7 +154,7 @@ class JsOnload (Behavior):
await tab.Runtime.callFunctionOn (functionDeclaration='function(){return this.stop();}', objectId=self.context)
await tab.Runtime.releaseObject (objectId=self.context)
return
- yield
+ yield # pragma: no cover
### Generic scripts ###
@@ -191,7 +191,7 @@ class EmulateScreenMetrics (Behavior):
await asyncio.sleep (1)
await tab.Emulation.clearDeviceMetricsOverride ()
return
- yield
+ yield # pragma: no cover
class DomSnapshotEvent:
__slots__ = ('url', 'document', 'viewport')
@@ -337,7 +337,7 @@ class Crash (Behavior):
except Crashed:
pass
return
- yield
+ yield # pragma: no cover
# available behavior scripts. Order matters, move those modifying the page
# towards the end of available
diff --git a/crocoite/test_behavior.py b/crocoite/test_behavior.py
index a1eef79..2c13804 100644
--- a/crocoite/test_behavior.py
+++ b/crocoite/test_behavior.py
@@ -69,7 +69,7 @@ class ClickTester (Behavior):
# assert any (map (lambda x: x['type'] == 'click', listeners)), listeners
return
- yield
+ yield # pragma: no cover
@pytest.mark.parametrize("url,selector", clickParam)
@pytest.mark.asyncio