diff options
author | Lars-Dominik Braun <lars@6xq.net> | 2018-12-24 09:43:45 +0100 |
---|---|---|
committer | Lars-Dominik Braun <lars@6xq.net> | 2018-12-24 09:43:45 +0100 |
commit | ba98bcd4a07c589722c6db103b363c8aa1d3561d (patch) | |
tree | 22c7651ad945c502e4b1154d8dccd7f0dcaaba54 /crocoite/test_devtools.py | |
parent | 36447c97a0036592d3748fbe594928ae9c76d5af (diff) | |
download | crocoite-ba98bcd4a07c589722c6db103b363c8aa1d3561d.tar.gz crocoite-ba98bcd4a07c589722c6db103b363c8aa1d3561d.tar.bz2 crocoite-ba98bcd4a07c589722c6db103b363c8aa1d3561d.zip |
Use f-strings where possible
Replaces str.format, which is less readable due to its separation of
format and arguments.
Diffstat (limited to 'crocoite/test_devtools.py')
-rw-r--r-- | crocoite/test_devtools.py | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/crocoite/test_devtools.py b/crocoite/test_devtools.py index 74d223f..3993edd 100644 --- a/crocoite/test_devtools.py +++ b/crocoite/test_devtools.py @@ -24,7 +24,8 @@ import pytest from aiohttp import web import websockets -from .devtools import Browser, Tab, MethodNotFound, Crashed, InvalidParameter, Process, Passthrough +from .devtools import Browser, Tab, MethodNotFound, Crashed, \ + InvalidParameter, Process, Passthrough @pytest.fixture async def browser (): @@ -73,8 +74,10 @@ async def test_tab_close (browser): @pytest.mark.asyncio async def test_tab_notify_enable_disable (tab): - """ Make sure enabling/disabling notifications works for all known namespaces """ - for name in ('Debugger', 'DOM', 'Log', 'Network', 'Page', 'Performance', 'Profiler', 'Runtime', 'Security'): + """ Make sure enabling/disabling notifications works for all known + namespaces """ + for name in ('Debugger', 'DOM', 'Log', 'Network', 'Page', 'Performance', + 'Profiler', 'Runtime', 'Security'): f = getattr (tab, name) await f.enable () await f.disable () @@ -149,7 +152,8 @@ async def test_tab_function (tab): @pytest.mark.asyncio async def test_tab_function_hash (tab): - d = {tab.Network.enable: 1, tab.Network.disable: 2, tab.Page: 3, tab.Page.enable: 4} + d = {tab.Network.enable: 1, tab.Network.disable: 2, tab.Page: 3, + tab.Page.enable: 4} assert len (d) == 4 @pytest.mark.asyncio @@ -168,5 +172,5 @@ async def test_passthrough (): url = 'http://localhost:12345' async with Passthrough (url) as u: - assert u == url + assert str (u) == url |