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

update requirements for unittest-xml #656

Merged
merged 7 commits into from
Nov 3, 2024
Merged

Conversation

FilMar
Copy link
Contributor

@FilMar FilMar commented Sep 24, 2024

Hi, i tried to launch the test with python 3.12 and i receive this error:
Traceback (most recent call last):

  File "/home/fildev/git_projects/dj-rest-auth/runtests.py", line 26, in <module>
    runtests()
  File "/home/fildev/git_projects/dj-rest-auth/runtests.py", line 17, in runtests
    TestRunner = get_runner(settings)
                 ^^^^^^^^^^^^^^^^^^^^
  File "/home/fildev/git_projects/dj-rest-auth/.venv/lib/python3.12/site-packages/django/test/utils.py", line 380, in get_runner
    test_module = __import__(test_module_name, {}, {}, test_path[-1])
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/fildev/git_projects/dj-rest-auth/.venv/lib/python3.12/site-packages/xmlrunner/__init__.py", line 11, in <module>
    from .runner import XMLTestRunner
  File "/home/fildev/git_projects/dj-rest-auth/.venv/lib/python3.12/site-packages/xmlrunner/runner.py", line 6, in <module>
    from .unittest import TextTestRunner, TestProgram
  File "/home/fildev/git_projects/dj-rest-auth/.venv/lib/python3.12/site-packages/xmlrunner/unittest.py", line 8, in <module>
    from unittest import TestResult, _TextTestResult
ImportError: cannot import name '_TextTestResult' from 'unittest' (/usr/lib/python3.12/unittest/__init__.py). Did you mean: 'TextTestResult'?

so i read the file /usr/lib/python3.12/unittest/init.py and how it's changed in the history and _TextTestResult is deprecated, from 3.12 it's removed. upgrade unittest-xml-reporting to latest version resolve the problem and tests work, i also added python 3.12 to list of test on workflow.

I'm sorry if i wrong something, this is my first contribution on github on a public project

@iMerica iMerica merged commit e5e07f3 into iMerica:master Nov 3, 2024
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

Successfully merging this pull request may close these issues.

2 participants