Path: csiph.com!goblin3!goblin.stu.neva.ru!news.roellig-ltd.de!open-news-network.org!weretis.net!feeder1.news.weretis.net!newsfeed.CARNet.hr!news.spin.it!bofh.it!news.nic.it!robomod From: Brian May Newsgroups: linux.debian.bugs.dist,linux.debian.maint.python Subject: Bug#802839: django-celery: python 3 tests not invoked and break Date: Sat, 24 Oct 2015 04:20:02 +0200 Message-ID: References: X-Original-To: 802839@bugs.debian.org, debian-python@lists.debian.org X-Mailbox-Line: From debian-bugs-dist-request@lists.debian.org Sat Oct 24 02:15:10 2015 Old-Return-Path: X-Spam-Flag: NO X-Spam-Score: -4.21 Reply-To: Brian May , 802839@bugs.debian.org Resent-To: debian-bugs-dist@lists.debian.org Resent-Cc: Debian Python Modules Team X-Debian-Pr-Message: followup 802839 X-Debian-Pr-Package: src:django-celery X-Debian-Pr-Source: django-celery X-Spam-Bayes: score:0.0000 Tokens: new, 12; hammy, 150; neutral, 111; spammy, 0. spammytokens: hammytokens:0.000-+--H*o:Debian, 0.000-+--python3, 0.000-+--traceback, 0.000-+--Python3, 0.000-+--Traceback Organization: Debian Content-Type: text/plain X-Debian-Message: from BTS X-Mailing-List: archive/latest/1219286 List-ID: List-URL: Approved: robomod@news.nic.it Lines: 57 Sender: robomod@news.nic.it X-Original-Date: Sat, 24 Oct 2015 13:11:25 +1100 X-Original-Message-ID: <87h9lhhv76.fsf@prune.linuxpenguins.xyz> X-Original-References: <20151024013437.6207.39326.reportbug@prune.linuxpenguins.xyz> Xref: csiph.com linux.debian.bugs.dist:689218 linux.debian.maint.python:7782 Brian May 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: [] != [] > > 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} > > - [] > + [] > > ---------------------------------------------------------------------- > 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