#34780: Tests don't pass on Python 3.11.4.
------------------------------+--------------------------------------
     Reporter:  wd0517        |                    Owner:  nobody
         Type:  Bug           |                   Status:  closed
    Component:  Core (Other)  |                  Version:  4.2
     Severity:  Normal        |               Resolution:  invalid
     Keywords:                |             Triage Stage:  Unreviewed
    Has patch:  0             |      Needs documentation:  0
  Needs tests:  0             |  Patch needs improvement:  0
Easy pickings:  0             |                    UI/UX:  0
------------------------------+--------------------------------------
Changes (by Mariusz Felisiak):

 * status:  new => closed
 * resolution:   => invalid
 * component:  Testing framework => Core (Other)


Old description:

> 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.

New description:

 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.
 }}}

--

Comment:

 Thanks for the report, it seems to be a regression in Python 3.11.4
 because `import_module()` doesn't raise `ImportError` for non-existent
 packages. I've reported this in Python bugtracker, check out
 [https://github.com/python/cpython/issues/108078 gh-108078].

-- 
Ticket URL: <https://code.djangoproject.com/ticket/34780#comment:2>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/django-updates/0107018a02e7865b-b47c4fd1-3534-4e2e-b433-8c24ebd20d56-000000%40eu-central-1.amazonses.com.

Reply via email to