Opened 2 years ago
Closed 2 years ago
#34780 closed Bug (invalid)
Tests don't pass on Python 3.11.4.
| Reported by: | wd0517 | Owned by: | nobody | 
|---|---|---|---|
| Component: | Core (Other) | Version: | 4.2 | 
| Severity: | Normal | Keywords: | |
| Cc: | Triage Stage: | Unreviewed | |
| Has patch: | no | Needs documentation: | no | 
| Needs tests: | no | Patch needs improvement: | no | 
| Easy pickings: | no | UI/UX: | no | 
Description (last modified by )
python version: 3.10.12, 3.11.4
django version: latest, stable/4.2.x
os: Ubuntu 22.04.1 LTS
when I run python tests/runtests.py -v2 check_framework, it failed
WARNINGS:
?: (templates.E003) 'cache' is used for multiple template tag modules: 'django.contrib.auth.templatetags.cache', 'django.contrib.contenttypes.templatetags.cache', 'django.contrib.messages.templatetags.cache', 'django.contrib.sessions.templatetags.cache', 'django.contrib.sites.templatetags.cache', 'django.contrib.staticfiles.templatetags.cache', 'django.templatetags.cache'
?: (templates.E003) 'i18n' is used for multiple template tag modules: 'django.contrib.auth.templatetags.i18n', 'django.contrib.contenttypes.templatetags.i18n', 'django.contrib.messages.templatetags.i18n', 'django.contrib.sessions.templatetags.i18n', 'django.contrib.sites.templatetags.i18n', 'django.contrib.staticfiles.templatetags.i18n', 'django.templatetags.i18n'
?: (templates.E003) 'l10n' is used for multiple template tag modules: 'django.contrib.auth.templatetags.l10n', 'django.contrib.contenttypes.templatetags.l10n', 'django.contrib.messages.templatetags.l10n', 'django.contrib.sessions.templatetags.l10n', 'django.contrib.sites.templatetags.l10n', 'django.contrib.staticfiles.templatetags.l10n', 'django.templatetags.l10n'
?: (templates.E003) 'static' is used for multiple template tag modules: 'django.contrib.auth.templatetags.static', 'django.contrib.contenttypes.templatetags.static', 'django.contrib.messages.templatetags.static', 'django.contrib.sessions.templatetags.static', 'django.contrib.sites.templatetags.static', 'django.contrib.staticfiles.templatetags.static', 'django.templatetags.static'
?: (templates.E003) 'tz' is used for multiple template tag modules: 'django.contrib.auth.templatetags.tz', 'django.contrib.contenttypes.templatetags.tz', 'django.contrib.messages.templatetags.tz', 'django.contrib.sessions.templatetags.tz', 'django.contrib.sites.templatetags.tz', 'django.contrib.staticfiles.templatetags.tz', 'django.templatetags.tz'
FAIL: test_template_tags_with_different_library_name (check_framework.test_templates.CheckTemplateTagLibrariesWithSameName)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/usr/lib/python3.10/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/usr/lib/python3.10/unittest/case.py", line 591, in run
    self._callTestMethod(testMethod)
  File "/usr/lib/python3.10/unittest/case.py", line 549, in _callTestMethod
    method()
  File "/home/ubuntu/django/tests/check_framework/test_templates.py", line 213, in test_template_tags_with_different_library_name
    self.assertEqual(check_for_template_tags_with_the_same_name(None), [])
  File "/usr/lib/python3.10/unittest/case.py", line 845, in assertEqual
    assertion_func(first, second, msg=msg)
  File "/usr/lib/python3.10/unittest/case.py", line 1051, in assertListEqual
    self.assertSequenceEqual(list1, list2, msg, seq_type=list)
  File "/usr/lib/python3.10/unittest/case.py", line 1033, in assertSequenceEqual
    self.fail(msg)
  File "/usr/lib/python3.10/unittest/case.py", line 675, in fail
    raise self.failureException(msg)
AssertionError: Lists differ: [<Warning: level=30, msg="'cache' is used [2046 chars]03'>] != []
First list contains 5 additional elements.
First extra element 0:
<Warning: level=30, msg="'cache' is used for multiple template tag modules: 'django.contrib.auth.templatetags.cache', 'django.contrib.contenttypes.templatetags.cache', 'django.contrib.messages.templatetags.cache', 'django.contrib.sessions.templatetags.cache', 'django.contrib.sites.templatetags.cache', 'django.contrib.staticfiles.templatetags.cache', 'django.templatetags.cache'", hint=None, obj=None, id='templates.E003'>
Diff is 2113 characters long. Set self.maxDiff to None to see it.
      Change History (2)
comment:1 by , 2 years ago
| Description: | modified (diff) | 
|---|
comment:2 by , 2 years ago
| Component: | Testing framework → Core (Other) | 
|---|---|
| Description: | modified (diff) | 
| Resolution: | → invalid | 
| Status: | new → closed | 
| Summary: | `check_framework` tests can not pass on ubuntu → Tests don't pass on Python 3.11.4. | 
Thanks for the report, it seems to be a regression in Python 3.11.4 because
import_module()doesn't raiseImportErrorfor non-existent packages. I've reported this in Python bugtracker, check out gh-108078.