Skip to content

Commit 84bc110

Browse files
committed
Update assertRaise to use context-manager format
1 parent 259fa8e commit 84bc110

1 file changed

Lines changed: 2 additions & 1 deletion

File tree

Lib/test/test_argparse.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,8 @@ def test_invalid_file_only(self):
8585
parser.print_usage,
8686
parser.print_help,
8787
):
88-
self.assertRaises(ValueError, func, "invalid file")
88+
with self.assertRaises(ValueError):
89+
func(file="invalid file")
8990

9091
def test_valid_file_invalid_stdout(self):
9192
parser = argparse.ArgumentParser()

0 commit comments

Comments
 (0)