Skip to content

Commit 732cd32

Browse files
linter fixes
1 parent 12eb9f9 commit 732cd32

File tree

5 files changed

+2
-14
lines changed

5 files changed

+2
-14
lines changed

elastic_transport/_node/_http_aiohttp.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,6 @@ async def perform_request( # type: ignore[override]
141141
headers: Optional[HttpHeaders] = None,
142142
request_timeout: Union[DefaultType, Optional[float]] = DEFAULT,
143143
) -> NodeApiResponse:
144-
global _AIOHTTP_FIXED_HEAD_BUG
145144
if self.session is None:
146145
self._create_aiohttp_session()
147146
assert self.session is not None

tests/async_/test_async_transport.py

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,6 @@ async def test_sniff_on_start():
389389
calls = []
390390

391391
def sniff_callback(*args):
392-
nonlocal calls
393392
calls.append(args)
394393
return [NodeConfig("http", "localhost", 80)]
395394

@@ -416,7 +415,6 @@ async def test_sniff_before_requests():
416415
calls = []
417416

418417
def sniff_callback(*args):
419-
nonlocal calls
420418
calls.append(args)
421419
return []
422420

@@ -442,7 +440,6 @@ async def test_sniff_on_node_failure():
442440
calls = []
443441

444442
def sniff_callback(*args):
445-
nonlocal calls
446443
calls.append(args)
447444
return []
448445

@@ -547,15 +544,15 @@ async def test_sniffed_nodes_added_to_pool(async_sniff_callback):
547544
if async_sniff_callback:
548545

549546
async def sniff_callback(*_):
550-
nonlocal loop, sniffed_at
547+
nonlocal sniffed_at
551548
await asyncio.sleep(0.1)
552549
sniffed_at = loop.time()
553550
return sniffed_nodes
554551

555552
else:
556553

557554
def sniff_callback(*_):
558-
nonlocal loop, sniffed_at
555+
nonlocal sniffed_at
559556
time.sleep(0.1)
560557
sniffed_at = loop.time()
561558
return sniffed_nodes

tests/test_node_pool.py

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -245,8 +245,6 @@ def __init__(self):
245245
self.nodes_gotten = 0
246246

247247
def run(self) -> None:
248-
nonlocal pool
249-
250248
while time.time() < start + 2:
251249
node = pool.get()
252250
self.nodes_gotten += 1

tests/test_transport.py

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -434,7 +434,6 @@ def test_sniff_on_start():
434434
calls = []
435435

436436
def sniff_callback(*args):
437-
nonlocal calls
438437
calls.append(args)
439438
return [NodeConfig("http", "localhost", 80)]
440439

@@ -458,7 +457,6 @@ def test_sniff_before_requests():
458457
calls = []
459458

460459
def sniff_callback(*args):
461-
nonlocal calls
462460
calls.append(args)
463461
return []
464462

@@ -482,7 +480,6 @@ def test_sniff_on_node_failure():
482480
calls = []
483481

484482
def sniff_callback(*args):
485-
nonlocal calls
486483
calls.append(args)
487484
return []
488485

@@ -655,8 +652,6 @@ def __init__(self):
655652
self.successful_requests = 0
656653

657654
def run(self) -> None:
658-
nonlocal t, start
659-
660655
while time.time() < start + 2:
661656
t.perform_request("GET", "/")
662657
self.successful_requests += 1

utils/build-dists.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,6 @@ def set_tmp_dir():
5454

5555

5656
def run(argv, expect_exit_code=0):
57-
global tmp_dir
5857
if tmp_dir is None:
5958
os.chdir(base_dir)
6059
else:

0 commit comments

Comments
 (0)