MCPcopy
hub / github.com/pex-tool/pex / test_iter_interpreter_mixed

Method test_iter_interpreter_mixed

tests/test_interpreter.py:171–187  ·  view source on GitHub ↗
(
        self, test_interpreter1, test_interpreter2, invalid_interpreter
    )

Source from the content-addressed store, hash-verified

169 self.assert_error(results[0], invalid_interpreter)
170
171 def test_iter_interpreter_mixed(
172 self, test_interpreter1, test_interpreter2, invalid_interpreter
173 ):
174 # type: (str, str, str) -> None
175 results = list(
176 PythonInterpreter.iter_candidates(
177 paths=[test_interpreter1, invalid_interpreter, test_interpreter2]
178 )
179 )
180
181 assert len(results) == 3
182 assert [
183 PythonInterpreter.from_binary(path) for path in (test_interpreter1, test_interpreter2)
184 ] == [result for result in results if isinstance(result, PythonInterpreter)]
185 errors = [result for result in results if not isinstance(result, PythonInterpreter)]
186 assert len(errors) == 1
187 self.assert_error(errors[0], invalid_interpreter)
188
189 def test_iter_interpreter_path_filter(self, test_interpreter1, test_interpreter2):
190 # type: (str, str) -> None

Callers

nothing calls this directly

Calls 3

assert_errorMethod · 0.95
iter_candidatesMethod · 0.80
from_binaryMethod · 0.80

Tested by

no test coverage detected