Skip to content

Commit 2cc2dbe

Browse files
committed
tests: apply fixes from fixit
RewriteToLiteral: It's slower to call list() than using the empty literal
1 parent 940a325 commit 2cc2dbe

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

tests/test_check.py

+10-10
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ def test_check_incorrect_iso_639_1_language(capsys):
257257

258258
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
259259
language = "es"
260-
exclude = list()
260+
exclude = []
261261

262262
# Create a dictionary to mimic Pandas series
263263
row = {"dc.title": title, "dc.language.iso": language}
@@ -277,7 +277,7 @@ def test_check_incorrect_iso_639_3_language(capsys):
277277

278278
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
279279
language = "spa"
280-
exclude = list()
280+
exclude = []
281281

282282
# Create a dictionary to mimic Pandas series
283283
row = {"dc.title": title, "dc.language.iso": language}
@@ -297,7 +297,7 @@ def test_check_correct_iso_639_1_language():
297297

298298
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
299299
language = "en"
300-
exclude = list()
300+
exclude = []
301301

302302
# Create a dictionary to mimic Pandas series
303303
row = {"dc.title": title, "dc.language.iso": language}
@@ -313,7 +313,7 @@ def test_check_correct_iso_639_3_language():
313313

314314
title = "A randomised vaccine field trial in Kenya demonstrates protection against wildebeest-associated malignant catarrhal fever in cattle"
315315
language = "eng"
316-
exclude = list()
316+
exclude = []
317317

318318
# Create a dictionary to mimic Pandas series
319319
row = {"dc.title": title, "dc.language.iso": language}
@@ -407,7 +407,7 @@ def test_check_doi_field():
407407
# the citation and a DOI field.
408408
d = {"cg.identifier.doi": doi, "dcterms.bibliographicCitation": citation}
409409
series = pd.Series(data=d)
410-
exclude = list()
410+
exclude = []
411411

412412
result = check.citation_doi(series, exclude)
413413

@@ -418,7 +418,7 @@ def test_check_doi_only_in_citation(capsys):
418418
"""Test an item with a DOI in its citation, but no DOI field."""
419419

420420
citation = "Orth, A. 2021. Testing all the things. doi: 10.1186/1743-422X-9-218"
421-
exclude = list()
421+
exclude = []
422422

423423
# Emulate a column in a transposed dataframe (which is just a series), with
424424
# an empty DOI field and a citation containing a DOI.
@@ -439,7 +439,7 @@ def test_title_in_citation():
439439

440440
title = "Testing all the things"
441441
citation = "Orth, A. 2021. Testing all the things."
442-
exclude = list()
442+
exclude = []
443443

444444
# Emulate a column in a transposed dataframe (which is just a series), with
445445
# the title and citation.
@@ -456,7 +456,7 @@ def test_title_not_in_citation(capsys):
456456

457457
title = "Testing all the things"
458458
citation = "Orth, A. 2021. Testing all teh things."
459-
exclude = list()
459+
exclude = []
460460

461461
# Emulate a column in a transposed dataframe (which is just a series), with
462462
# the title and citation.
@@ -477,7 +477,7 @@ def test_country_matches_region():
477477

478478
country = "Kenya"
479479
region = "Eastern Africa"
480-
exclude = list()
480+
exclude = []
481481

482482
# Emulate a column in a transposed dataframe (which is just a series)
483483
d = {"cg.coverage.country": country, "cg.coverage.region": region}
@@ -495,7 +495,7 @@ def test_country_not_matching_region(capsys):
495495
country = "Kenya"
496496
region = ""
497497
missing_region = "Eastern Africa"
498-
exclude = list()
498+
exclude = []
499499

500500
# Emulate a column in a transposed dataframe (which is just a series)
501501
d = {

tests/test_fix.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ def test_fix_country_not_matching_region():
131131
country = "Kenya"
132132
region = ""
133133
missing_region = "Eastern Africa"
134-
exclude = list()
134+
exclude = []
135135

136136
# Emulate a column in a transposed dataframe (which is just a series)
137137
d = {

0 commit comments

Comments
 (0)