Skip to content

Commit 9213234

Browse files
Tell linter about unused assignments.
1 parent 7b76cc5 commit 9213234

File tree

1 file changed

+26
-26
lines changed

1 file changed

+26
-26
lines changed

src/pyff/test/test_pipeline.py

+26-26
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ class LoadErrorTest(PipeLineTest):
108108
# A File that does not exist must throw an error with fail_on_error=True
109109
def test_fail_on_error_no_file(self):
110110
try:
111-
res, md = self.exec_pipeline(
111+
res, _md = self.exec_pipeline(
112112
f"""
113113
- load fail_on_error True:
114114
- {self.datadir}/file_that_does_not_exist.xml
@@ -126,7 +126,7 @@ def test_fail_on_error_no_file(self):
126126
# A File that does not exist must throw an error with fail_on_error=True
127127
def test_fail_on_error_no_file_url(self):
128128
try:
129-
res, md = self.exec_pipeline(
129+
res, _md = self.exec_pipeline(
130130
f"""
131131
- load fail_on_error True:
132132
- file://{self.datadir}/file_that_does_not_exist.xml
@@ -145,7 +145,7 @@ def test_fail_on_error_no_file_url(self):
145145
# Note: Due to load_url retries it takes 20s to complete this test
146146
def test_fail_on_error_no_url(self):
147147
try:
148-
res, md = self.exec_pipeline(
148+
res, _md = self.exec_pipeline(
149149
"""
150150
- load fail_on_error True:
151151
- http://127.0.0.1/does_not_exist.xml
@@ -163,7 +163,7 @@ def test_fail_on_error_no_url(self):
163163
# A file with invalid XML must throw an exception with fail_on_error True:
164164
def test_fail_on_error_invalid_file(self):
165165
try:
166-
res, md = self.exec_pipeline(
166+
res, _md = self.exec_pipeline(
167167
f"""
168168
- load fail_on_error True:
169169
- {self.datadir}/metadata/test01.xml
@@ -181,7 +181,7 @@ def test_fail_on_error_invalid_file(self):
181181
# A directory with a file with invalid metadata must throw an exception with fail_on_error True and filter_invalid False:
182182
def test_fail_on_error_invalid_dir(self):
183183
try:
184-
res, md = self.exec_pipeline(
184+
res, _md = self.exec_pipeline(
185185
f"""
186186
- load fail_on_error True filter_invalid False:
187187
- {self.datadir}/metadata/
@@ -197,7 +197,7 @@ def test_fail_on_error_invalid_dir(self):
197197

198198
# A file with invalid XML must not throw an exception by default (fail_on_error False):
199199
def test_no_fail_on_error_invalid_file(self):
200-
res, md = self.exec_pipeline(
200+
_res, md = self.exec_pipeline(
201201
f"""
202202
- load:
203203
- {self.datadir}/metadata/test01.xml
@@ -212,7 +212,7 @@ def test_no_fail_on_error_invalid_file(self):
212212
# Loading an xml file with an invalid entity must throw when filter_invalid False and fail_on_error True
213213
def test_fail_on_error_invalid_entity(self):
214214
try:
215-
res, md = self.exec_pipeline(
215+
res, _md = self.exec_pipeline(
216216
f"""
217217
- load fail_on_error True filter_invalid False:
218218
- {self.datadir}/metadata/test01.xml
@@ -231,7 +231,7 @@ def test_fail_on_error_invalid_entity(self):
231231

232232
# Test default behaviour. Loading a file with an invalid entity must not raise an exception
233233
def test_no_fail_on_error_invalid_entity(self):
234-
res, md = self.exec_pipeline(
234+
_res, md = self.exec_pipeline(
235235
f"""
236236
- load:
237237
- {self.datadir}/metadata/test01.xml
@@ -245,7 +245,7 @@ def test_no_fail_on_error_invalid_entity(self):
245245

246246
# A directory with a file with invalid metadata must not throw by default:
247247
def test_no_fail_on_error_invalid_dir(self):
248-
res, md = self.exec_pipeline(
248+
_res, md = self.exec_pipeline(
249249
f"""
250250
- load:
251251
- {self.datadir}/metadata/
@@ -263,7 +263,7 @@ class SortTest(PipeLineTest):
263263
EID3 = "https://sharav.abes.fr/idp/shibboleth"
264264

265265
@staticmethod
266-
def _run_sort_test(expected_order, sxp, res, l):
266+
def _run_sort_test(expected_order, sxp, res, output):
267267
if sxp is not None:
268268
# Verify expected warnings for missing sort values
269269
for e in expected_order:
@@ -275,11 +275,11 @@ def _run_sort_test(expected_order, sxp, res, l):
275275
f"Sort pipe: unable to sort entity by '{sxp}'. Entity '{e[0]}' has no such value"
276276
)
277277
try:
278-
assert keygen_fail_str in str(l)
278+
assert keygen_fail_str in str(output)
279279
except AssertionError:
280280
print(
281281
f"Test failed on expecting missing sort value from: '{e[0]}'.\n"
282-
f"Could not find string on the output: '{keygen_fail_str}'.\nOutput was:\n {l}"
282+
f"Could not find string on the output: '{keygen_fail_str}'.\nOutput was:\n {output}"
283283
)
284284
raise
285285
except (IndexError, TypeError):
@@ -308,7 +308,7 @@ def _run_sort_test(expected_order, sxp, res, l):
308308
# Test sort by entityID only
309309
def test_sort(self):
310310
sxp = None
311-
res, md = self.exec_pipeline(
311+
res, _md = self.exec_pipeline(
312312
f"""
313313
- load:
314314
- {self.datadir}/metadata/test01.xml
@@ -370,16 +370,16 @@ def test_sort_group(self):
370370
class SigningTest(PipeLineTest):
371371
def test_signing(self):
372372
self.output = tempfile.NamedTemporaryFile('w').name
373-
res, md, ctx = self.run_pipeline("signer.fd", self)
373+
_res, md, _ctx = self.run_pipeline("signer.fd", self)
374374
eIDs = [e.get('entityID') for e in md.store]
375375
assert 'https://idp.aco.net/idp/shibboleth' in eIDs
376376
assert 'https://skriptenforum.net/shibboleth' in eIDs
377377
os.unlink(self.output)
378378

379379
def test_signing_and_validation(self):
380380
self.output = tempfile.NamedTemporaryFile('w').name
381-
res_s, md_s, ctx_s = self.run_pipeline("signer.fd", self)
382-
res_v, md_v, ctx_v = self.run_pipeline("validator.fd", self)
381+
_res_s, _md_s, _ctx_s = self.run_pipeline("signer.fd", self)
382+
_res_v, md_v, _ctx_v = self.run_pipeline("validator.fd", self)
383383

384384
eIDs = [e.get('entityID') for e in md_v.store]
385385
assert 'https://idp.aco.net/idp/shibboleth' in eIDs
@@ -388,7 +388,7 @@ def test_signing_and_validation(self):
388388

389389
def test_cert_report(self):
390390
self.output = tempfile.NamedTemporaryFile('w').name
391-
res, md, ctx = self.run_pipeline("certreport.fd", self)
391+
_res, md, _ctx = self.run_pipeline("certreport.fd", self)
392392
eIDs = [e.get('entityID') for e in md.store]
393393
assert 'https://idp.aco.net/idp/shibboleth' in eIDs
394394
assert 'https://skriptenforum.net/shibboleth' in eIDs
@@ -398,7 +398,7 @@ def test_cert_report(self):
398398

399399
def test_cert_report_swamid(self):
400400
self.output = tempfile.NamedTemporaryFile('w').name
401-
res, md, ctx = self.run_pipeline("certreport-swamid.fd", self)
401+
_res, md, _ctx = self.run_pipeline("certreport-swamid.fd", self)
402402
with open(self.output) as fd:
403403
print(fd.read())
404404

@@ -529,7 +529,7 @@ def test_prune(self):
529529
finally:
530530
try:
531531
os.unlink(tmpfile)
532-
except:
532+
except Exception:
533533
pass
534534

535535
def test_empty_store(self):
@@ -632,14 +632,14 @@ def test_pick_invalid(self):
632632
finally:
633633
try:
634634
os.unlink(tmpfile)
635-
except:
635+
except Exception:
636636
pass
637637

638638
def test_blacklist_single_file(self):
639639
entity = 'https://idp.example.com/saml2/idp/metadata.php'
640640

641641
# First, load without a filter to ensure the entity is there
642-
res, md = self.exec_pipeline(
642+
_res, md = self.exec_pipeline(
643643
f"""
644644
- when batch:
645645
- load:
@@ -649,7 +649,7 @@ def test_blacklist_single_file(self):
649649
assert md.lookup(entity)
650650

651651
# Then, load with a filter and ensure the entity isn't there anymore
652-
res, md = self.exec_pipeline(
652+
_res, md = self.exec_pipeline(
653653
f"""
654654
- when batch:
655655
- load:
@@ -670,7 +670,7 @@ def test_blacklist_directory(self):
670670
entity = 'https://idp.example.com/saml2/idp/metadata.php'
671671

672672
# First, load without a filter to ensure the entity is there
673-
res, md = self.exec_pipeline(
673+
_res, md = self.exec_pipeline(
674674
f"""
675675
- when batch:
676676
- load:
@@ -680,7 +680,7 @@ def test_blacklist_directory(self):
680680
assert md.lookup(entity)
681681

682682
# Then, load with a filter and ensure the entity isn't there anymore
683-
res, md = self.exec_pipeline(
683+
_res, md = self.exec_pipeline(
684684
f"""
685685
- when batch:
686686
- load:
@@ -695,7 +695,7 @@ def test_blacklist_directory(self):
695695

696696
def test_bad_namespace(self):
697697
try:
698-
res, md = self.exec_pipeline(
698+
_res, _md = self.exec_pipeline(
699699
f"""
700700
- when batch:
701701
- load:
@@ -710,7 +710,7 @@ def test_bad_namespace(self):
710710

711711
def test_parsecopy_(self):
712712
entity = 'https://idp.example.com/saml2/idp/metadata.php'
713-
res, md = self.exec_pipeline(
713+
_res, md = self.exec_pipeline(
714714
f"""
715715
- when batch:
716716
- load:

0 commit comments

Comments
 (0)