diff --git a/tests/python/pants_test/backend/python/tasks/native/test_ctypes_integration.py b/tests/python/pants_test/backend/python/tasks/native/test_ctypes_integration.py index 4df6d205edb..f8ef8d2e0cc 100644 --- a/tests/python/pants_test/backend/python/tasks/native/test_ctypes_integration.py +++ b/tests/python/pants_test/backend/python/tasks/native/test_ctypes_integration.py @@ -110,56 +110,6 @@ def _assert_ctypes_binary_creation(self, toolchain_variant): binary_run_output = invoke_pex_for_output(pex) self.assertEqual(b'x=3, f(x)=17\n', binary_run_output) - def test_invalidation_ctypes(self): - """Test that the current version of a python_dist() is resolved after modifying its sources.""" - with temporary_dir() as tmp_dir: - with self.mock_buildroot( - dirs_to_copy=[self._binary_target_dir]) as buildroot, buildroot.pushd(): - - def run_target(goal): - return self.run_pants_with_workdir( - command=[goal, self._binary_target], - workdir=os.path.join(buildroot.new_buildroot, '.pants.d'), - build_root=buildroot.new_buildroot, - config={ - GLOBAL_SCOPE_CONFIG_SECTION: { - 'pants_distdir': tmp_dir, - }, - }, - ) - - output_pex = os.path.join(tmp_dir, 'bin.pex') - - initial_result_message = 'x=3, f(x)=17' - - unmodified_pants_run = run_target('run') - self.assert_success(unmodified_pants_run) - self.assertIn(initial_result_message, unmodified_pants_run.stdout_data) - - unmodified_pants_binary_create = run_target('binary') - self.assert_success(unmodified_pants_binary_create) - binary_run_output = invoke_pex_for_output(output_pex).decode('utf-8') - self.assertIn(initial_result_message, binary_run_output) - - # Modify one of the source files for this target so that the output is different. - cpp_source_file = os.path.join(self._binary_target_dir, 'some_more_math.cpp') - with open(cpp_source_file, 'r') as f: - orig_contents = f.read() - modified_contents = re.sub(r'3', '4', orig_contents) - with open(cpp_source_file, 'w') as f: - f.write(modified_contents) - - modified_result_message = 'x=3, f(x)=28' - - modified_pants_run = run_target('run') - self.assert_success(modified_pants_run) - self.assertIn(modified_result_message, modified_pants_run.stdout_data) - - modified_pants_binary_create = run_target('binary') - self.assert_success(modified_pants_binary_create) - binary_run_output = invoke_pex_for_output(output_pex).decode('utf-8') - self.assertIn(modified_result_message, binary_run_output) - def test_ctypes_native_language_interop(self): for variant in ToolchainVariant.allowed_values: self._assert_ctypes_interop_with_mock_buildroot(variant)