def METHOD_NAME(self, test_env):
    test_env.from_string('{% from "foo" import bar, baz with context %}')
    test_env.from_string('{% from "foo" import bar, baz, with context %}')
    test_env.from_string('{% from "foo" import bar, with context %}')
    test_env.from_string('{% from "foo" import bar, with, context %}')
    test_env.from_string('{% from "foo" import bar, with with context %}')
    with pytest.raises(TemplateSyntaxError):
        test_env.from_string('{% from "foo" import bar,, with context %}')
    with pytest.raises(TemplateSyntaxError):
        test_env.from_string('{% from "foo" import bar with context, %}')