183b0b0853fc79810e76f5144686bb6fdb317dda,tests/python/pants_test/base/test_target.py,TargetTest,test_derived_from_chain,#TargetTest#,40

Before Change


    )

  def test_derived_from_chain(self):
    context = self.context()

    // add concrete target
    build_file = self.add_to_build_file("y/BUILD", dedent("""
    java_library(
      name="concrete",
      sources=["SourceA.scala"],
    )
    """))
    concrete_address = BuildFileAddress(build_file, "concrete")
    context.build_graph.inject_address_closure(concrete_address)
    concrete = context.build_graph.get_target(concrete_address)

    // add synthetic targets
    syn_one = context.add_new_target(SyntheticAddress("y", "syn_one"),
                                     JavaLibrary,
                                     derived_from=concrete,
                                     sources=["SourceB.scala"])
    syn_two = context.add_new_target(SyntheticAddress("y", "syn_two"),
                                     JavaLibrary,
                                     derived_from=syn_one,
                                     sources=["SourceC.scala"])

    // validate
    self.assertEquals(list(syn_two.derived_from_chain), [syn_one, concrete])
    self.assertEquals(list(syn_one.derived_from_chain), [concrete])

After Change


class TargetTest(BaseTest):
  def test_derived_from_chain(self):
    // add concrete target
    concrete = self.make_target("y:concrete", Target)

    // add synthetic targets
    syn_one = self.make_target("y:syn_one", Target, derived_from=concrete)
    syn_two = self.make_target("y:syn_two", Target, derived_from=syn_one)

    // validate
    self.assertEquals(list(syn_two.derived_from_chain), [syn_one, concrete])
    self.assertEquals(list(syn_one.derived_from_chain), [concrete])
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 5

Instances


Project Name: pantsbuild/pants
Commit Name: 183b0b0853fc79810e76f5144686bb6fdb317dda
Time: 2015-08-30
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/base/test_target.py
Class Name: TargetTest
Method Name: test_derived_from_chain


Project Name: pantsbuild/pants
Commit Name: 4395289966d6ec4a9525367c82629c35fb461b2a
Time: 2019-04-24
Author: 1305167+cosmicexplorer@users.noreply.github.com
File Name: tests/python/pants_test/backend/native/tasks/test_cpp_compile.py
Class Name: CppCompileTest
Method Name: test_target_level_toolchain_variant_llvm


Project Name: pantsbuild/pants
Commit Name: ad9f8480c8e08b95d6c217ec4a126bd93b7f376a
Time: 2015-08-31
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/backend/jvm/targets/test_jvm_app.py
Class Name: BundleTest
Method Name: test_globs_relative_to_build_root