Subject: bug#70815: [PATCH] ; Enahnce python-tests.el to adapt different python interpreters

From: Mattias Engdegård <[email-masked]>
Date: Tue, 28 May 2024 14:30:45 +0200

27 maj 2024 kl. 14.33 skrev kobarity <[email-masked]>:

> We probably have found the bug with Python 2 on Mac, unless
> there is a bug on the ERTs.

It could just be a mismatch of expectations. With python-shell-interpreter set to "python2", tab-completion in the Python interactive shell works but in a diminished capacity. For example, 'pri<TAB>' completes to 'print' but 'math.sq<TAB>' does not complete to 'math.sqrt(' as it does in Python 3.

> Changing the order of the interpreters to find or skipping
> some ERTs does not solve the problem.

But it does fix a different problem: it tests python-mode with Python 3, which is more important.

>  However, it seems that only a
> limited number of people can pursue the problem on Mac, and fewer
> people will have trouble with Python 2 issues.  So for now, I think it
> is better to skip these ERTs for Python 2 on Mac only.

We can probably agree that absent explicit information about what version the user wants tested, we should test python-mode with Python 3 on macOS and other platforms.

If you think it is important we can also test it with Python 2 if available. Rejigging the tests to run for multiple Python versions is certainly possible but would be some work.

Meanwhile I'm just going to make the tests use the same logic as python.el for selecting the binary to use, as there does not seem to be a reason why this would make anything worse.