Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.maint.python > #7782
| From | Brian May <bam@debian.org> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.maint.python |
| Subject | Bug#802839: django-celery: python 3 tests not invoked and break |
| Date | 2015-10-24 04:20 +0200 |
| Message-ID | <qmWB4-3gM-5@gated-at.bofh.it> (permalink) |
| References | <qmVYl-2cr-3@gated-at.bofh.it> |
| Organization | Debian |
Cross-posted to 2 groups.
Brian May <bam@debian.org> writes:
> ======================================================================
> FAIL: test_discovery_with_broken (djcelery.tests.test_discovery.TestDiscovery)
> ----------------------------------------------------------------------
> Traceback (most recent call last):
> File "/home/brian/tree/debian/python-modules/django-celery/tests/../djcelery/tests/test_discovery.py", line 45, in test_discovery_with_broken
> self.assertEqual(log, [])
> AssertionError: Lists differ: [<warnings.WarningMessage object at 0x7f2b03474c88>] != []
>
> First list contains 1 additional elements.
> First extra element 0:
> {message : ResourceWarning("unclosed file <_io.TextIOWrapper name='/home/brian/tree/debian/python-modules/django-celery/tests/someapp/tasks.py' mode='r' encoding='utf-8'>",), category : 'ResourceWarning', filename : '/home/brian/tree/debian/python-modules/django-celery/tests/../djcelery/loaders.py', lineno : 204, line : None}
>
> - [<warnings.WarningMessage object at 0x7f2b03474c88>]
> + []
>
> ----------------------------------------------------------------------
> Ran 66 tests in 0.340s
>
> FAILED (errors=2, failures=1)
That includes a debug message I put in. Oops. Showing the warning object
that caused the problem.
It seems that Python3 is generating an unexpected error ("unclosed
file") that is upsetting the test because it expects 0 warnings.
Any ideas how to fix this? It doesn't appear to be this project that is
producing the warning, maybe that comes from Django.
Or should I just remove the Assert?
The code in question that appears to be producing the warning:
def autodiscover():
"""Include tasks for all applications in ``INSTALLED_APPS``."""
global _RACE_PROTECTION
if _RACE_PROTECTION:
return
_RACE_PROTECTION = True
try:
if django.VERSION < (1, 7):
return filter(None, [find_related_module(app, 'tasks')
for app in settings.INSTALLED_APPS])
else:
from django.apps import apps
return filter(None, [find_related_module(app.name, 'tasks')
for app in apps.get_app_configs()])
finally:
_RACE_PROTECTION = False
This is in git, in the expected python-modules location.
--
Brian May <bam@debian.org>
Back to linux.debian.maint.python | Previous | Next — Next in thread | Find similar | Unroll thread
Bug#802839: django-celery: python 3 tests not invoked and break Brian May <bam@debian.org> - 2015-10-24 04:20 +0200
Bug#802839: django-celery: python 3 tests not invoked and break Robert Collins <robertc@robertcollins.net> - 2015-10-24 06:00 +0200
Bug#802839: django-celery: python 3 tests not invoked and break Brian May <bam@debian.org> - 2015-10-25 02:30 +0200
csiph-web