Skip to content

Commit 72aac67

Browse files
author
taras
committed
Fix lint warnings
1 parent 16e75a9 commit 72aac67

File tree

4 files changed

+9
-12
lines changed

4 files changed

+9
-12
lines changed

examples/echo_client_benchmark.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,7 @@
55
import subprocess
66

77
from logging import getLogger
8-
from ssl import SSLContext
9-
from typing import List, Dict, Tuple
8+
from typing import List, Dict
109

1110
import numpy as np
1211
import websockets
@@ -35,6 +34,7 @@ def create_client_ssl_context():
3534
async def picows_main(endpoint: str, msg: bytes, duration: int, ssl_context):
3635
cl_type = "plain" if ssl_context is None else "ssl"
3736
print(f"Run picows python {cl_type} client")
37+
3838
class PicowsClientListener(WSListener):
3939
def __init__(self):
4040
super().__init__()
@@ -69,7 +69,7 @@ async def websockets_main(endpoint: str, msg: bytes, duration: int, ssl_context)
6969
start_time = time()
7070
cnt = 0
7171
while True:
72-
reply = await websocket.recv()
72+
await websocket.recv()
7373
cnt += 1
7474
if time() - start_time >= duration:
7575
break
@@ -163,12 +163,12 @@ async def aiohttp_main(url: str, data: bytes, duration: int, ssl_context):
163163
try:
164164
from examples.echo_client_cython import picows_main_cython
165165
if not args.picows_ssl_only:
166-
print(f"Run picows cython plain client")
166+
print("Run picows cython plain client")
167167
rps = asyncio.run(picows_main_cython(plain_url, msg, duration, None))
168168
RPS["plain"].append(rps)
169169

170170
if not args.picows_plain_only:
171-
print(f"Run picows cython ssl client")
171+
print("Run picows cython ssl client")
172172
rps = asyncio.run(picows_main_cython(ssl_url, msg, duration, ssl_context))
173173
RPS["ssl"].append(rps)
174174

@@ -177,7 +177,7 @@ async def aiohttp_main(url: str, data: bytes, duration: int, ssl_context):
177177
pass
178178

179179
if not args.picows_plain_only and not args.picows_ssl_only and args.boost_client is not None:
180-
print(f"Run boost.beast plain client")
180+
print("Run boost.beast plain client")
181181
pr = subprocess.run([args.boost_client, b"0",
182182
args.host.encode(),
183183
args.plain_port.encode(),
@@ -186,15 +186,15 @@ async def aiohttp_main(url: str, data: bytes, duration: int, ssl_context):
186186
_, rps = pr.stdout.split(b":", 2)
187187
RPS["plain"].append(int(rps.decode()))
188188

189-
print(f"Run boost.beast ssl client")
189+
print("Run boost.beast ssl client")
190190
pr = subprocess.run([args.boost_client, b"1",
191191
args.host.encode(),
192192
args.ssl_port.encode(),
193193
args.msg_size, args.duration],
194194
shell=False, check=True, capture_output=True)
195195
name, rps = pr.stdout.split(b":", 2)
196196
RPS["ssl"].append(int(rps.decode()))
197-
NAMES.append(f"c++ boost.beast")
197+
NAMES.append("c++ boost.beast")
198198

199199
if args.picows_plain_only or args.picows_ssl_only:
200200
exit()

examples/echo_server.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
import pathlib
44
import ssl
55
from logging import getLogger, INFO, basicConfig
6-
from ssl import SSLContext
76

87
from picows import WSFrame, WSTransport, ws_create_server, WSListener, WSMsgType, WSUpgradeRequest
98

examples/readme_client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,4 +21,4 @@ async def main(url):
2121

2222
if __name__ == '__main__':
2323
asyncio.set_event_loop_policy(uvloop.EventLoopPolicy())
24-
asyncio.run(main("ws://127.0.0.1:9001"))
24+
asyncio.run(main("ws://127.0.0.1:9001"))

tests/test_basics.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88
import picows
99
import pytest
1010
import async_timeout
11-
import os
1211

1312

1413
TIMEOUT = 0.5
@@ -291,7 +290,6 @@ class ServerClientListener(picows.WSListener):
291290
def on_ws_connected(self, transport: picows.WSTransport):
292291
raise RuntimeError("exception from on_ws_connected")
293292

294-
295293
server = await picows.ws_create_server(lambda _: ServerClientListener(),
296294
"127.0.0.1", 0)
297295
async with ServerAsyncContext(server):

0 commit comments

Comments
 (0)