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

From: kobarity <[email-masked]>
Date: Mon, 27 May 2024 21:33:03 +0900

Mattias Engdegård wrote:
> > Please try evaluating the following expression in the Python buffer
> > after invoking Inferior Python buffer running Python 2.
> > 
> > (python-shell-send-string-no-output "print('a')")
> 
> The result is "a".

Thanks.  Then I have no idea why it fails.  It's difficult for me to
further investigate as I don't have Mac environment.

Mattias Engdegård wrote:
> Kobarity and Lin Sun, wouldn't it make sense to tie the interpreter to test to `python-shell-interpreter`?

I don't think it is a good idea.  `python-shell-interpreter' can be a
variety of things.  It may be IPython, PyPy, or even Poetry.
`python-tests-shell-interpreter' exists to override
`python-shell-interpreter'.

Lin Sun wrote:
> Hi Eli, it's not worth to make the cases for user perfers EMACS_PYTHON_INTERPRETER. 
> It's failed naturally if the interpreter version is not supported anymore or not supported yet.

I think we are still supporting Python 2 on Mac.  It is just that
there seems to be problems with some features.

ERTs exist to find bugs.  In that sense, I think the ERTs have worked
well.  We probably have found the bug with Python 2 on Mac, unless
there is a bug on the ERTs.  So the natural and best course is to fix
that bug.  Changing the order of the interpreters to find or skipping
some ERTs does not solve the problem.  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.

The problem is that there is no convenient way to skip some ERTs based
on the interpreter's version.  I will think about it, but it will be
over the weekend at the earliest.