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

ScriptTestCase.test_script_run fails with Python 3.13.0a3 #214

Closed
befeleme opened this issue Feb 14, 2024 · 2 comments
Closed

ScriptTestCase.test_script_run fails with Python 3.13.0a3 #214

befeleme opened this issue Feb 14, 2024 · 2 comments

Comments

@befeleme
Copy link

befeleme commented Feb 14, 2024

Describe the bug

Distlib's test fails with Python 3.13.0a3. Is has run successfully with the previous alpha.

=================================== FAILURES ===================================
________________________ ScriptTestCase.test_script_run ________________________

self = <test_scripts.ScriptTestCase testMethod=test_script_run>

    def test_script_run(self):
        if sys.version_info[:2] < (3, 13):
            target = 'cgi:print_directory'
        else:
            target = 'test.support.interpreters:list_all'
        files = self.maker.make('test = %s' % target)
        self.assertEqual(len(files), 2)
        p = subprocess.Popen([sys.executable, files[0]],
                             stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        stdout, stderr = p.communicate()
        if sys.version_info[:2] < (3, 13):
            self.assertIn(b'<H3>Current Working Directory:</H3>', stdout)
            self.assertIn(os.getcwd().encode('utf-8'), stdout)
        else:
>           self.assertIn(b'[Interpreter(id=0, isolated=None)]', stderr)
E           AssertionError: b'[Interpreter(id=0, isolated=None)]' not found in b'Traceback (most recent call last):\n  File "/tmp/distlib-test-5n5zd_29/test", line 5, in <module>\n    from test.support.interpreters import list_all\nModuleNotFoundError: No module named \'test.support.interpreters\'\n'

tests/test_scripts.py:342: AssertionError
=========================== short test summary info ============================
FAILED tests/test_scripts.py::ScriptTestCase::test_script_run - AssertionErro...

To Reproduce
Steps to reproduce the behavior:

  1. run tox -e py313

Environment

  • Fedora Linux 39
  • current master branch
@vsajip
Copy link
Collaborator

vsajip commented Feb 14, 2024

Hmmm ... I get a different result, is yours reproducible?

$ PYTHONHASHSEED=0 ~/projects/cpython/main/python tests/test_all.py
............................s.................................................s....s.......s........................s.ssssss..........sss..Fs..ss.........................s..........s..........................ssss.........ss.............
======================================================================
FAIL: test_script_run (test_scripts.ScriptTestCase.test_script_run)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/disk2/vinay/projects/distlib/tests/test_scripts.py", line 343, in test_script_run
    self.assertIn(b'[Interpreter(id=0, isolated=None)]', stderr)
    ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AssertionError: b'[Interpreter(id=0, isolated=None)]' not found in b'[Interpreter(0)]\n'

----------------------------------------------------------------------
Ran 236 tests in 26.112s

FAILED (failures=1, skipped=25)

That's just a change in the textual representation, which I'll update the test to handle. I don't get the

No module named 'test.support.interpreters'

exception.

@vsajip vsajip closed this as completed in 1c08845 Feb 14, 2024
@befeleme
Copy link
Author

Yes, it's consistent. Apparently, test/support/interpreters became a module in Python 3.13.0a3 and wasn't being installled: python/cpython#115421 This will be fixed in the next alpha.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants