Skip to content

Commit 2012364

Browse files
committed
Pyflakes ignore iderectly used variables
They are (potentionally) used in a compile statement where their usage is invisible for pyflakes. Ready for merge - Legacy-Id: 9311
1 parent 65c052a commit 2012364

1 file changed

Lines changed: 7 additions & 6 deletions

File tree

ietf/api/tests.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,11 +46,13 @@ def test_api_top_level(self):
4646

4747
def _assertCallbackReturnsSameJSON(self, api_url, json_dict):
4848
cbclient = Client(Accept='text/javascript')
49-
identity = lambda x: x
49+
identity = lambda x: x # pyflakes:ignore
50+
5051
# To be able to eval JSON, we need to have three more symbols
51-
true = True
52-
false = False
53-
null = None
52+
# They are used indirectly
53+
true = True # pyflakes:ignore
54+
false = False # pyflakes:ignore
55+
null = None # pyflakes:ignore
5456
r = cbclient.get(api_url + '?callback=identity')
5557
code = compile(r.content, '<string>', 'eval')
5658
# Make sure it is just a call with the identity function
@@ -86,9 +88,8 @@ def test_all_model_resources_exist(self):
8688
"There doesn't seem to be any API resource for model %s.models.%s"%(app.__name__,model.__name__,))
8789

8890
def test_invalid_jsonp_callback_value(self):
89-
cbclient = Client(Accept='text/javascript')
9091
try:
91-
r = cbclient.get("/api/v1?callback=$.23")
92+
Client(Accept='text/javascript').get("/api/v1?callback=$.23")
9293
except BadRequest:
9394
return
9495
self.assertTrue(False,

0 commit comments

Comments
 (0)