File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,15 +33,17 @@ def test_import_from_registers_object_by_asname(self):
3333 self .assertNotIn ("path" , scope )
3434
3535 def test_relative_import_raises (self ):
36- """level > 0 (relative import) must raise ValueError."""
3736 node = ast .parse ("from .foo import bar" ).body [0 ]
38- with self .assertRaises (ValueError ):
37+ with self .assertRaises (
38+ ValueError , msg = "level > 0 (relative import) must raise ValueError."
39+ ):
3940 import_parser .build_scope (import_froms = [node ])
4041
4142 def test_none_module_raises (self ):
42- """module=None with level=0 must also raise ValueError."""
4343 node = ast .ImportFrom (module = None , names = [ast .alias (name = "something" )], level = 0 )
44- with self .assertRaises (ValueError ):
44+ with self .assertRaises (
45+ ValueError , msg = "module=None with level=0 must also raise ValueError."
46+ ):
4547 import_parser .build_scope (import_froms = [node ])
4648
4749
You can’t perform that action at this time.
0 commit comments