df75d99aa353ecf4dd69185232041c952a3f72b7,tests/python/pants_test/graph/test_build_graph.py,BuildGraphTest,test_transitive_closure_address,#BuildGraphTest#,87

Before Change


  // TODO(Eric Ayers) This test broke during a refactoring and should be moved removed or updated
  @pytest.mark.xfail
  def test_transitive_closure_address(self):
    with self.workspace("./BUILD", "a/BUILD", "a/b/BUILD") as root_dir:
      with open(os.path.join(root_dir, "./BUILD"), "w") as build:
        build.write(dedent("""
          fake(name="foo",
               dependencies=[
                 "a",
               ])
        """))

      with open(os.path.join(root_dir, "a/BUILD"), "w") as build:
        build.write(dedent("""
          fake(name="a",
               dependencies=[
                 "a/b:bat",
               ])
        """))

      with open(os.path.join(root_dir, "a/b/BUILD"), "w") as build:
        build.write(dedent("""
          fake(name="bat")
        """))
      def fake_target(*args, **kwargs):
        assert False, "This fake target should never be called in this test!"

      alias_map = {"target_aliases": {"fake": fake_target}}
      self.build_file_parser.register_alias_groups(alias_map=alias_map)

      bf_address = BuildFileAddress(BuildFile(root_dir, "BUILD"), "foo")
      self.build_file_parser._populate_target_proxy_transitive_closure_for_address(bf_address)
      self.assertEqual(len(self.build_file_parser._target_proxy_by_address), 3)

  // TODO(Eric Ayers) This test broke during a refactoring and should be moved, removed or updated
  @pytest.mark.xfail
  def test_no_targets(self):
    self.add_to_build_file("empty/BUILD", "pass")
    with pytest.raises(BuildFileParser.EmptyBuildFileException):

After Change


        target(name="bat")
      """))

    root_address = SyntheticAddress.parse("//:foo")
    self.build_graph.inject_address_closure(root_address)
    self.assertEqual(len(self.build_graph.transitive_subgraph_of_addresses([root_address])), 3)

  def test_no_targets(self):
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: pantsbuild/pants
Commit Name: df75d99aa353ecf4dd69185232041c952a3f72b7
Time: 2014-12-03
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/graph/test_build_graph.py
Class Name: BuildGraphTest
Method Name: test_transitive_closure_address


Project Name: pantsbuild/pants
Commit Name: 24d8a1652b3bf99115c67ba9f47e06b172fe8e00
Time: 2015-10-09
Author: john.sirois@gmail.com
File Name: src/python/pants/engine/exp/mapper.py
Class Name: AddressMap
Method Name: parse


Project Name: graphbrain/graphbrain
Commit Name: b354803b038659359816213443108cf0ee18f74a
Time: 2020-01-08
Author: telmo@telmomenezes.net
File Name: graphbrain/agents/txt_parser.py
Class Name: TxtParser
Method Name: input_file