tests = set()
for target in targets:
if is_java(target) and is_test(target):
tests.update(self.normalize(test, target.target_base) for test in target.sources
if is_test_file(test))
return tests
After Change
def calculate_tests(self, targets):
for target in targets:
if (is_java(target) or is_scala(target)) and is_test(target):
for test in target.sources:
for cls in self.normalize(test, target.target_base):
yield cls
def normalize(self, classname_or_file, basedir=None):
components = classname_or_file.split("//", 2)
classname = components[0]
methodname = "//" + components[1] if len(components) == 2 else ""