e7b9ce76c065eb9ba46791fbef67a4961150dd2c,tests/python/pants_test/java/distribution/test_distribution.py,MockDistributionTest,distribution,#MockDistributionTest#Any#Any#Any#,49
Before Change
@contextmanager
def distribution(self, files=None, executables=None, libs=None):
with temporary_dir() as jdk_root:
jdk_bin_dir = os.path.join(jdk_root, "bin")
os.mkdir(jdk_bin_dir)
for f in maybe_list(files or ()):
touch(os .path.join(jdk_bin_dir, f))
for exe in maybe_list(executables or (), expected_type=self.EXE):
path = os.path.join(jdk_bin_dir, exe.name)
with safe_open(path, "w") as fp:
After Change
@contextmanager
def distribution(self, files=None, executables=None, java_home=None):
with temporary_dir() as dist_root:
with environment_as(DIST_ROOT=os.path.join(dist_root, java_home) if java_home else dist_root):
for f in maybe_list(files or ()):
touch(os.path.join(dist_root, f))
for exe in maybe_list(executables or (), expected_type=self.EXE):
path = os.path.join(dist_root, exe.relpath)
with safe_open(path, "w") as fp:
fp.write(exe.contents or "")
chmod_plus_x(path)
yield dist_root
def setUp(self):
super(MockDistributionTest, self).setUp()
// Save local cache and then flush so tests get a clean environment. _CACHE restored in tearDown.
self._local_cache = Distribution._CACHE
In pattern: SUPERPATTERN
Frequency: 3
Non-data size: 6
Instances Project Name: pantsbuild/pants
Commit Name: e7b9ce76c065eb9ba46791fbef67a4961150dd2c
Time: 2015-05-18
Author: john.sirois@gmail.com
File Name: tests/python/pants_test/java/distribution/test_distribution.py
Class Name: MockDistributionTest
Method Name: distribution
Project Name: pantsbuild/pants
Commit Name: 5503041efa4c6b9ac892c46da8f0de5715a05322
Time: 2016-03-24
Author: stuhood@gmail.com
File Name: tests/python/pants_test/backend/jvm/subsystems/test_jar_dependency_management_integration.py
Class Name: JarDependencyManagementIntegrationTest
Method Name: _testing_build_file
Project Name: pantsbuild/pants
Commit Name: 68b64f050901cb96e492b4346359ad0c078ac6c2
Time: 2017-04-21
Author: benjyw@gmail.com
File Name: src/python/pants/backend/python/tasks2/pytest_run.py
Class Name: PytestRun
Method Name: _conftest