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

Test issues with Python 3.13 #208

Closed
hroncok opened this issue Oct 23, 2023 · 1 comment
Closed

Test issues with Python 3.13 #208

hroncok opened this issue Oct 23, 2023 · 1 comment

Comments

@hroncok
Copy link

hroncok commented Oct 23, 2023

Describe the bug

Hello. In Fedora, we are testing our Python packages with Python 3.13.0a1 to discover problems early.
distlib is one of the packages that fails with it.

To Reproduce
Steps to reproduce the behavior:

  1. tox -e py313

Expected behavior
Tests pass

Actual behavior

======================================================================
FAIL: test_script_run (test_scripts.ScriptTestCase.test_script_run)
----------------------------------------------------------------------
Traceback (most recent call last):
  File ".../pypa/distlib/tests/test_scripts.py", line 335, in test_script_run
    self.assertIn(b'<H3>Current Working Directory:</H3>', stdout)
AssertionError: b'<H3>Current Working Directory:</H3>' not found in b''

----------------------------------------------------------------------
Ran 216 tests in 26.446s

FAILED (failures=1, skipped=24)

Environment

  • Fedora Linux 37 to 40
  • Python 3.13.0a1
  • 0.3.7 or 65a014b

Additional information

I believe that the called subprocess fails (the call does not check that) and the error is in stderr (the test does not display that). The cig module was removed in Python 3.13, see https://docs.python.org/3.13/whatsnew/3.13.html


I also accidentally found out that there are removed unittest functions used in test_version.py, however hose are not used when running the testsuite via tox. To reproduce, run:

$ .tox/py313/bin/python tests/test_version.py 
Traceback (most recent call last):
  File ".../pypa/distlib/tests/test_version.py", line 668, in <module>
    unittest.main(defaultTest="test_suite")
  File "/usr/lib64/python3.13/unittest/main.py", line 103, in __init__
    self.parseArgs(argv)
  File "/usr/lib64/python3.13/unittest/main.py", line 142, in parseArgs
    self.createTests()
  File "/usr/lib64/python3.13/unittest/main.py", line 153, in createTests
    self.test = self.testLoader.loadTestsFromNames(self.testNames,
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/loader.py", line 207, in loadTestsFromNames
    suites = [self.loadTestsFromName(name, module) for name in names]
              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/loader.py", line 192, in loadTestsFromName
    test = obj()
           ^^^^^
  File ".../pypa/distlib/tests/test_version.py", line 648, in test_suite
    suite = [unittest.makeSuite(VersionTestCase),
             ^^^^^^^^^^^^^^^^^^
  File "/usr/lib64/python3.13/unittest/__init__.py", line 80, in __getattr__
    raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
AttributeError: module 'unittest' has no attribute 'makeSuite'

The makeSuite thing was also removed in Python 3.13.

@vsajip vsajip closed this as completed in e27569b Oct 23, 2023
@vsajip
Copy link
Collaborator

vsajip commented Oct 23, 2023

Thanks for the report!

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