|
21 | 21 | import time
|
22 | 22 | import unittest
|
23 | 23 |
|
24 |
| -# pylint: disable=deprecated-module |
25 |
| -from distutils.spawn import find_executable |
| 24 | +from shutil import which |
26 | 25 |
|
27 | 26 | from libtest import env
|
28 | 27 |
|
@@ -71,7 +70,7 @@ def teardown_method(self, _):
|
71 | 70 | if os.path.isdir(self.report_dir):
|
72 | 71 | shutil.rmtree(self.report_dir)
|
73 | 72 |
|
74 |
| - @unittest.skipIf(find_executable('clang-apply-replacements') is None, |
| 73 | + @unittest.skipIf(which('clang-apply-replacements') is None, |
75 | 74 | "clang-apply-replacements clang tool must be available "
|
76 | 75 | "in the environment.")
|
77 | 76 | def test_fixit_list(self):
|
@@ -167,7 +166,7 @@ def test_fixit_list(self):
|
167 | 166 | self.assertIn("v.empty()", new_source_file)
|
168 | 167 | self.assertNotIn("v.size()", new_source_file)
|
169 | 168 |
|
170 |
| - @unittest.skipIf(find_executable('clang-apply-replacements') is None, |
| 169 | + @unittest.skipIf(which('clang-apply-replacements') is None, |
171 | 170 | "clang-apply-replacements clang tool must be available "
|
172 | 171 | "in the environment.")
|
173 | 172 | def test_fixit_file_modification(self):
|
@@ -255,7 +254,7 @@ def test_fixit_file_modification(self):
|
255 | 254 | self.assertIn('Skipped files due to modification since last analysis',
|
256 | 255 | err)
|
257 | 256 |
|
258 |
| - @unittest.skipIf(find_executable('clang-apply-replacements') is None, |
| 257 | + @unittest.skipIf(which('clang-apply-replacements') is None, |
259 | 258 | "clang-apply-replacements clang tool must be available "
|
260 | 259 | "in the environment.")
|
261 | 260 | def test_fixit_by_diff(self):
|
@@ -353,7 +352,7 @@ def test_fixit_by_diff(self):
|
353 | 352 | print('\n' + out + '\n')
|
354 | 353 | self.assertEqual(out.count("DiagnosticMessage"), 1)
|
355 | 354 |
|
356 |
| - @unittest.skipIf(find_executable('clang-apply-replacements') is None, |
| 355 | + @unittest.skipIf(which('clang-apply-replacements') is None, |
357 | 356 | "clang-apply-replacements clang tool must be available "
|
358 | 357 | "in the environment.")
|
359 | 358 | def test_fixit_apply_failure(self):
|
|
0 commit comments