Skip to content

Commit 22cc215

Browse files
author
Alex Boten
authored
[build] bump pylint (#923)
* [build] bump pylint Fixes #632 * apply lint suggestions * specify encoding
1 parent d54b61e commit 22cc215

File tree

7 files changed

+20
-17
lines changed

7 files changed

+20
-17
lines changed

dev-requirements.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pylint<2.10
1+
pylint==2.12.2
22
flake8~=3.7
33
isort~=5.6
44
black>=22.1.0

exporter/opentelemetry-exporter-richconsole/setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
BASE_DIR, "src", "opentelemetry", "exporter", "richconsole", "version.py"
2222
)
2323
PACKAGE_INFO = {}
24-
with open(VERSION_FILENAME) as f:
24+
with open(VERSION_FILENAME, encoding="utf-8") as f:
2525
exec(f.read(), PACKAGE_INFO)
2626

2727
setuptools.setup(version=PACKAGE_INFO["__version__"])

instrumentation/opentelemetry-instrumentation-aiopg/tests/test_aiopg_integration.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -507,6 +507,7 @@ def __init__(self, database, server_port, server_host, user):
507507
self.server_host = server_host
508508
self.user = user
509509

510+
# pylint: disable=no-self-use
510511
async def release(self, conn):
511512
return conn
512513

@@ -542,11 +543,11 @@ def __init__(self, database, server_port, server_host, user):
542543
database, server_port, server_host, user
543544
)
544545

545-
# pylint: disable=no-self-use
546546
def cursor(self):
547547
coro = self._cursor()
548548
return _ContextManager(coro) # pylint: disable=no-value-for-parameter
549549

550+
# pylint: disable=no-self-use
550551
async def _cursor(self):
551552
return MockCursor()
552553

@@ -585,13 +586,15 @@ async def __aenter__(self):
585586

586587

587588
class AiopgPoolMock:
589+
# pylint: disable=no-self-use
588590
async def release(self, conn):
589591
return conn
590592

591593
def acquire(self):
592594
coro = self._acquire()
593595
return _PoolAcquireContextManager(coro, self)
594596

597+
# pylint: disable=no-self-use
595598
async def _acquire(self):
596599
return AiopgConnectionMock()
597600

instrumentation/opentelemetry-instrumentation-asgi/tests/test_asgi_middleware.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -310,10 +310,10 @@ def test_traceresponse_header(self):
310310
self.assertEqual(response_body["body"], b"*")
311311
self.assertEqual(response_start["status"], 200)
312312

313-
traceresponse = "00-{0}-{1}-01".format(
314-
format_trace_id(span.get_span_context().trace_id),
315-
format_span_id(span.get_span_context().span_id),
316-
)
313+
trace_id = format_trace_id(span.get_span_context().trace_id)
314+
span_id = format_span_id(span.get_span_context().span_id)
315+
traceresponse = f"00-{trace_id}-{span_id}-01"
316+
317317
self.assertListEqual(
318318
response_start["headers"],
319319
[
@@ -423,10 +423,10 @@ def test_websocket_traceresponse_header(self):
423423
span = self.memory_exporter.get_finished_spans()[-1]
424424
self.assertEqual(trace_api.SpanKind.SERVER, span.kind)
425425

426-
traceresponse = "00-{0}-{1}-01".format(
427-
format_trace_id(span.get_span_context().trace_id),
428-
format_span_id(span.get_span_context().span_id),
429-
)
426+
trace_id = format_trace_id(span.get_span_context().trace_id)
427+
span_id = format_span_id(span.get_span_context().span_id)
428+
traceresponse = f"00-{trace_id}-{span_id}-01"
429+
430430
self.assertListEqual(
431431
socket_send["headers"],
432432
[

instrumentation/opentelemetry-instrumentation-django/tests/test_middleware_asgi.py

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -368,12 +368,11 @@ async def test_trace_response_headers(self):
368368
response["Access-Control-Expose-Headers"],
369369
"traceresponse",
370370
)
371+
trace_id = format_trace_id(span.get_span_context().trace_id)
372+
span_id = format_span_id(span.get_span_context().span_id)
371373
self.assertEqual(
372374
response["traceresponse"],
373-
"00-{}-{}-01".format(
374-
format_trace_id(span.get_span_context().trace_id),
375-
format_span_id(span.get_span_context().span_id),
376-
),
375+
f"00-{trace_id}-{span_id}-01",
377376
)
378377
self.memory_exporter.clear()
379378

instrumentation/opentelemetry-instrumentation-pymemcache/tests/test_pymemcache.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,7 +106,7 @@ def test_set_not_recording(self):
106106
def test_get_many_none_found(self):
107107
client = self.make_client([b"END\r\n"])
108108
result = client.get_many([b"key1", b"key2"])
109-
assert result == {}
109+
assert not result
110110

111111
spans = self.memory_exporter.get_finished_spans()
112112

@@ -116,7 +116,7 @@ def test_get_multi_none_found(self):
116116
client = self.make_client([b"END\r\n"])
117117
# alias for get_many
118118
result = client.get_multi([b"key1", b"key2"])
119-
assert result == {}
119+
assert not result
120120

121121
spans = self.memory_exporter.get_finished_spans()
122122

opentelemetry-instrumentation/src/opentelemetry/instrumentation/utils.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,7 @@ def _generate_sql_comment(**meta):
131131

132132
# Sort the keywords to ensure that caching works and that testing is
133133
# deterministic. It eases visual inspection as well.
134+
# pylint: disable=consider-using-f-string
134135
return (
135136
" /*"
136137
+ _KEY_VALUE_DELIMITER.join(

0 commit comments

Comments
 (0)