Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add runtime check for valid Python interpreter #7365

merged 13 commits into from Mar 14, 2019
Commits on Mar 12, 2019
  1. Simplify skip_unless_any_pythons_present()

    Eric-Arellano committed Mar 12, 2019
    Use any() builtin. Earlier we were checking how many pythons are discovered. I realized that skipIf doesn't print the message when False, so this isn't very useful to spend the time figuring out as no one will read the message. Instead, make the code simpler.
  2. Improve error message

    Eric-Arellano committed Mar 12, 2019
  3. Improve test variable name

    Eric-Arellano committed Mar 12, 2019
  4. Convert integration test to 2 unit tests

    Eric-Arellano committed Mar 12, 2019
    Integration test was never going to work because we run from pants.pex and can't change the interpreter for the subprocess. Even if we could, the subprocess would start bootstrapping Pants, which we do NOT want.
    Further, patching the integration test won't work because the ./pants run is a subprocess so won't pick up on the patch.
    Instead, we can split the functionality into two dedicated unit tests and actually end up with better coverage and faster tests!
  5. Add future backports

    Eric-Arellano committed Mar 12, 2019
    Ironic I forgot to do this. Can't wait for us to stop having the cognitive load of remembering these imports..

    Eric-Arellano committed Mar 12, 2019
    We warned you!
  7. Deduplicate calling sys.version_info[0:2]

    Eric-Arellano committed Mar 12, 2019
    Use string interpolation rather than ".".join() to avoid an unnecessary line.
  8. Remove unneeded `as e` in with statement

    Eric-Arellano committed Mar 12, 2019
    Sorry for the email spam. This is ready for review now.
Commits on Mar 13, 2019
  1. Fix bad import

    Eric-Arellano committed Mar 13, 2019
    Mock only was made part of stdlib in Py3.
Commits on Mar 14, 2019
  1. Fix leftover --pants-engine-python-version from #7363

    Eric-Arellano committed Mar 14, 2019
  2. Fix unit test assertIns not actually ever running

    Eric-Arellano committed Mar 14, 2019
    TIL, with self.assertRaises() is only meant to capture the error. The code will exit the with statements once the exception is caught. So, the 3 assertions we had were never actually running.
    Also, one assertion was too brittle so it's removed.
You can’t perform that action at this time.