def test_addressable_exceptions(self):
    self.add_to_build_file('b/BUILD', 'java_library(name="foo", "bad_arg")')
    build_file_b = self.create_buildfile('b/BUILD')
    expected_msg = ('positional argument follows keyword argument' if PY3 else 'non-keyword arg after keyword arg')
    self.assert_parser_error(build_file_b, expected_msg)
    self.add_to_build_file('d/BUILD', dedent('\n      java_library(\n        name="foo",\n        dependencies=[\n          object(),\n        ]\n      )\n      '))
    build_file_d = self.create_buildfile('d/BUILD')
    self.assert_parser_error(build_file_d, 'dependencies passed to Target constructors must be strings')
def test_addressable_exceptions(self):
    self.add_to_build_file('b/BUILD', 'java_library(name="foo", "bad_arg")')
    build_file_b = self.create_buildfile('b/BUILD')
    expected_msg = ('positional argument follows keyword argument' if PY3 else 'non-keyword arg after keyword arg')
    self.assert_parser_error(build_file_b, expected_msg)
    self.add_to_build_file('d/BUILD', dedent('\n      java_library(\n        name="foo",\n        dependencies=[\n          object(),\n        ]\n      )\n      '))
    build_file_d = self.create_buildfile('d/BUILD')
    self.assert_parser_error(build_file_d, 'dependencies passed to Target constructors must be strings')