Skip to content

Missing trailing : on emitted with statement #18

@jayvdb

Description

@jayvdb

The tool chokes on https://github.com/coala/coala/blob/8a25983/tests/parsing/CliParsingTest.py#L58

Somehow it writes with statements without a trailing :.

         sections = parse_cli(arg_list=['--relpath'])
-        with self.assertRaisesRegex(SystemExit, '2') as cm:
+        with pytest.raises(SystemExit) as excinfo
+        assert re.search(pattern, excinfo.value) as cm:
             check_conflicts(sections)
-            self.assertEqual(cm.exception.code, 2)
+            assert cm.exception.code == 2
 
         sections = parse_cli(arg_list=['--output', 'iraiseValueError'])
-        with self.assertRaisesRegex(SystemExit, '2') as cm:
+        with pytest.raises(SystemExit) as excinfo
+        assert re.search(pattern, excinfo.value) as cm:
             check_conflicts(sections)
-            self.assertEqual(cm.exception.code, 2)
+            assert cm.exception.code == 2

The result is naturally a syntax error: https://travis-ci.org/jayvdb/coala/jobs/246949584#L9068

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions