Skip to content

Commit af5539c

Browse files
committed
Fix issues detected by bugbear linting
1 parent 0719e75 commit af5539c

2 files changed

Lines changed: 6 additions & 8 deletions

File tree

tests/test_properties.py

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -524,9 +524,7 @@ def test_date_docprops_with_format_get_updated(self):
524524
assert len(document.paragraphs) == 3, "input file should contain 3 paragraph"
525525

526526
expected_values = ["11.06.19", "mardi 11 juin 2019", "11-6-19 0:0:0"]
527-
for i, (expected, paragraph) in enumerate(
528-
zip(expected_values, document.paragraphs)
529-
):
527+
for expected, paragraph in zip(expected_values, document.paragraphs):
530528
assert paragraph.text == expected
531529

532530
CustomProperties(document).update_all()
@@ -544,19 +542,19 @@ def test_date_docprops_respect_language(self):
544542
assert len(document.paragraphs) == 3, "input file should contain 3 paragraph"
545543

546544
CustomProperties(document).update_all()
547-
document.paragraphs[1].text == "jeudi 23 janvier 2020"
545+
assert document.paragraphs[1].text == "jeudi 23 janvier 2020"
548546

549547
document.element.xpath(".//w:lang")[0].set(
550548
docx.oxml.shared.qn("w:val"), "de-CH"
551549
)
552550
CustomProperties(document).update_all()
553-
document.paragraphs[1].text == "Donnerstag 23 Januar 2020"
551+
assert document.paragraphs[1].text == "Donnerstag 23 Januar 2020"
554552

555553
document.element.xpath(".//w:lang")[0].set(
556554
docx.oxml.shared.qn("w:val"), "en-US"
557555
)
558556
CustomProperties(document).update_all()
559-
document.paragraphs[1].text == "Thursday 23 January 2020"
557+
assert document.paragraphs[1].text == "Thursday 23 January 2020"
560558

561559
def test_docprops_with_split_fieldname_get_updated(self):
562560
document = Document(docx_path("complex_field_with_split_fieldname.docx"))

tests/utils.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,9 @@ class ComposedDocument(ComparableDocument):
102102
103103
"""
104104

105-
def __init__(self, master_filename, filename, *filenames):
105+
def __init__(self, master_filename, *filenames):
106106
composer = Composer(Document(docx_path(master_filename)))
107-
for filename in (filename,) + filenames:
107+
for filename in filenames:
108108
composer.append(Document(docx_path(filename)))
109109

110110
super(ComposedDocument, self).__init__(composer.doc)

0 commit comments

Comments
 (0)