#21416 closed Uncategorized (needsinfo)

admin_scripts.tests.ManageValidate.test_app_with_import() fails with enabled warnings

Reported by: Arfrever Owned by: nobody
Component: Testing framework Version: 1.6
Severity: Normal Keywords:
Cc: Arfrever Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

admin_scripts.tests.ManageValidate.test_app_with_import() fails, when warnings are enabled (using PYTHONWARNINGS="d,i::ImportWarning" environmental variable).
This failure occurs in Django 1.6 and does not occur in Django 1.5.5.

$ PYTHONPATH="." PYTHONWARNINGS="d,i::ImportWarning" python2.7 tests/runtests.py --settings=test_sqlite -v1 admin_scripts
Creating test database for alias 'default'...
Creating test database for alias 'other'...
........................................................................................................................................F..................
======================================================================
FAIL: test_app_with_import (admin_scripts.tests.ManageValidate)
manage.py validate does not raise errors when an app imports a base class that itself has an abstract base
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/Django-1.6/tests/admin_scripts/tests.py", line 1094, in test_app_with_import
    self.assertNoOutput(err)
  File "/tmp/Django-1.6/tests/admin_scripts/tests.py", line 182, in assertNoOutput
    self.assertEqual(len(stream), 0, "Stream should be empty: actually contains '%s'" % stream)
AssertionError: 282 != 0 : Stream should be empty: actually contains '/tmp/Django-1.6/django/contrib/comments/__init__.py:9: PendingDeprecationWarning: django.contrib.comments is deprecated and will be removed before Django 1.8.
  warnings.warn("django.contrib.comments is deprecated and will be removed before Django 1.8.", PendingDeprecationWarning)
'

----------------------------------------------------------------------
Ran 155 tests in 211.841s

FAILED (failures=1)
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...

Change History (3)

comment:1 Changed 19 months ago by Arfrever

  • Cc Arfrever added
  • Needs documentation unset
  • Needs tests unset
  • Patch needs improvement unset

comment:2 Changed 19 months ago by timo

I can reproduce this. May I ask why you want to run the tests in this particular way?

comment:3 Changed 19 months ago by timo

  • Resolution set to needsinfo
  • Status changed from new to closed
Note: See TracTickets for help on using tickets.
Back to Top