4b2376655a5bc5627fdac748c5ffda11b543719d,test/run_tests.py,,importTests,#,27
Before Change
match = re.match("^(test_(.*))\\.py$", file)
if match:
m = match.group(1)
print("Adding test cases in %s" % m)
module = __import__(m)
tests.addTest(unittest.defaultTestLoader.loadTestsFromModule( module ))
return tests
After Change
def importTests():
tests = unittest.TestSuite()
for root, dirs, files in os.walk(".."):
files[:] = [x for x in files if re.match("^(test_(.*))\\.py$", x)]
for file in files:
match = re.match("^(test_(.*))\\.py$", file)
m = match.group(1)
print("Adding test cases in {}/{}".format(root, file))
sys.path.insert(0, root)
module = __import__(m)
tests.addTest(unittest.defaultTestLoader.loadTestsFromModule( module ))
dirs[:] = [x for x in dirs if not x.startswith(".") and x not in ("dist", "build", "development")]
return tests
if __name__ == "__main__":
test_runner = unittest.TextTestRunner(verbosity=2)
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 5
Instances Project Name: vatlab/SoS
Commit Name: 4b2376655a5bc5627fdac748c5ffda11b543719d
Time: 2016-11-21
Author: ben.bog@gmail.com
File Name: test/run_tests.py
Class Name:
Method Name: importTests
Project Name: EpistasisLab/scikit-rebate
Commit Name: dce26436def31dd947dbe20ee11b81d7a8f157bf
Time: 2018-11-10
Author: alexmxu99@gmail.com
File Name: outputparse.py
Class Name:
Method Name:
Project Name: vatlab/SoS
Commit Name: 4b2376655a5bc5627fdac748c5ffda11b543719d
Time: 2016-11-21
Author: ben.bog@gmail.com
File Name: test/run_tests.py
Class Name:
Method Name: importTests
Project Name: facebookresearch/ParlAI
Commit Name: 9fc989afc19ec56ccbf0b7b966d34bfdd254c651
Time: 2017-05-06
Author: ahm@fb.com
File Name: parlai/tasks/opensubtitles/build.py
Class Name:
Method Name: create_fb_format