Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.maint.python > #7782

Bug#802839: django-celery: python 3 tests not invoked and break

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 <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 Sat, 24 Oct 2015 04:20:02 +0200
Message-ID <qmWB4-3gM-5@gated-at.bofh.it> (permalink)
References <qmVYl-2cr-3@gated-at.bofh.it>
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 <debbugs@buxtehude.debian.org>
X-Spam-Flag NO
X-Spam-Score -4.21
Reply-To Brian May <bam@debian.org>, 802839@bugs.debian.org
Resent-To debian-bugs-dist@lists.debian.org
Resent-Cc Debian Python Modules Team <python-modules-team@lists.alioth.debian.org>
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 <debian-bugs-dist@lists.debian.org> archive/latest/1219286
List-ID <debian-bugs-dist.lists.debian.org>
List-URL <https://lists.debian.org/debian-bugs-dist/>
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

Cross-posted to 2 groups.

Show key headers only | View raw


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 | NextNext in thread | Find similar | Unroll thread


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