-
-
Notifications
You must be signed in to change notification settings - Fork 32.9k
Closed
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error
Description
There are several tests that do not assert anything:
Lines 539 to 547 in 9649278
def test_init(self): | |
with LZMAFile(BytesIO(COMPRESSED_XZ)) as f: | |
pass | |
with LZMAFile(BytesIO(), "w") as f: | |
pass | |
with LZMAFile(BytesIO(), "x") as f: | |
pass | |
with LZMAFile(BytesIO(), "a") as f: | |
pass |
Lines 574 to 594 in 9649278
def test_init_mode(self): | |
with TempFile(TESTFN): | |
with LZMAFile(TESTFN, "r"): | |
pass | |
with LZMAFile(TESTFN, "rb"): | |
pass | |
with LZMAFile(TESTFN, "w"): | |
pass | |
with LZMAFile(TESTFN, "wb"): | |
pass | |
with LZMAFile(TESTFN, "a"): | |
pass | |
with LZMAFile(TESTFN, "ab"): | |
pass | |
def test_init_with_x_mode(self): | |
self.addCleanup(unlink, TESTFN) | |
for mode in ("x", "xb"): | |
unlink(TESTFN) | |
with LZMAFile(TESTFN, mode) as f: | |
pass |
I propose to assert the context manager type and the mode.
I have a PR ready.
Linked PRs
Metadata
Metadata
Assignees
Labels
testsTests in the Lib/test dirTests in the Lib/test dirtype-bugAn unexpected behavior, bug, or errorAn unexpected behavior, bug, or error