[Django] #25110: A test in test_runner fails

7 views
Skip to first unread message

Django

unread,
Jul 12, 2015, 1:28:37 AM7/12/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+--------------------
Reporter: double-y | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------------+--------------------
I run tests with Python 3.4.3 but failed like this.

{{{
% ./runtests.py ./test_runner
Testing against Django installed in
'/Users/yasudayousuke/oss_hack/django_dev/django_parent/django'
Creating test database for alias 'default'...
Creating test database for alias 'other'...
.....F...........ss.......................
======================================================================
FAIL: test_duplicates_ignored
(test_runner.test_discover_runner.DiscoverRunnerTest)
----------------------------------------------------------------------
Traceback (most recent call last):
File
"/Users/yasudayousuke/oss_hack/django_dev/django_parent/tests/test_runner/test_discover_runner.py",
line 133, in test_duplicates_ignored
self.assertEqual(single, dups)
AssertionError: 259 != 260

----------------------------------------------------------------------
Ran 42 tests in 4.421s

FAILED (failures=1, skipped=2)
Destroying test database for alias 'default'...
Destroying test database for alias 'other'...
}}}

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

Django

unread,
Jul 12, 2015, 1:51:52 PM7/12/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------

Reporter: double-y | Owner: nobody
Type: Bug | Status: new
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by timgraham):

* needs_better_patch: => 0
* stage: Unreviewed => Accepted
* needs_tests: => 0
* needs_docs: => 0


Comment:

Bisected to ad0be620aece4dde2f94383426c284f4afef9fbc

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:1>

Django

unread,
Jul 14, 2015, 6:57:53 PM7/14/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned

Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------
Changes (by JMGordon):

* status: new => assigned
* cc: JMGordon (added)
* owner: nobody => JMGordon


--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:2>

Django

unread,
Jul 20, 2015, 3:31:03 PM7/20/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by claudep):

I think I've at least identified the issue. When `test_discover_runner` is
run and `gis_tests` is not in current test labels, the discovery process
inside the test fails with the error:
RuntimeError: Model class gis_tests.geo3d.models.City3D doesn't
declare an explicit app_label and either isn't in an application in
INSTALLED_APPS or else was imported before its application was loaded.

Then that discovery result is not considered as duplicate, hence the test
failure.

I don't know right now what's the best resolution would be, apart from
recreating an embedded app structure inside test_runner or in a
`../test_discovery_sample`-like dir, which might be overkill just for that
test.

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:3>

Django

unread,
Jul 20, 2015, 3:37:46 PM7/20/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by claudep):

Maybe with that patch:
{{{
#!diff
diff --git a/tests/test_runner/test_discover_runner.py
b/tests/test_runner/test_discover_runner.py
index 70117f0..4a3613e 100644
--- a/tests/test_runner/test_discover_runner.py
+++ b/tests/test_runner/test_discover_runner.py
@@ -121,9 +121,11 @@ class DiscoverRunnerTest(TestCase):
"""
Tests shouldn't be discovered twice when discovering on
overlapping paths.
"""
- single =
DiscoverRunner().build_suite(["gis_tests"]).countTestCases()
- dups = DiscoverRunner().build_suite(
- ["gis_tests", "gis_tests.geo3d"]).countTestCases()
+ with self.modify_settings(INSTALLED_APPS={'append':
'gis_tests.geo3d'}):
+ suite = DiscoverRunner().build_suite(["gis_tests.geo3d",
"gis_tests.geo3d"])
+ single =
DiscoverRunner().build_suite(["gis_tests"]).countTestCases()
+ dups = DiscoverRunner().build_suite(
+ ["gis_tests", "gis_tests.geo3d"]).countTestCases()
self.assertEqual(single, dups)

def test_reverse(self):
}}}

Joseph, still interested to test that and cook a patch?

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:4>

Django

unread,
Jul 25, 2015, 7:15:45 PM7/25/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by JMGordon):

Yes, still interested. I'll test it out.

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:5>

Django

unread,
Jul 26, 2015, 12:11:22 AM7/26/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by JMGordon):

Looks like it fixed the assertion error. Is the next step to create a pull
request (this is my first time interacting with the Django project)?

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:6>

Django

unread,
Jul 26, 2015, 5:23:00 AM7/26/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by claudep):

Yes, please.

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:7>

Django

unread,
Jul 26, 2015, 9:30:47 AM7/26/15
to django-...@googlegroups.com
#25110: A test in test_runner fails
-----------------------------------+------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-----------------------------------+------------------------------------

Comment (by JMGordon):

Made pull request:

https://github.com/django/django/pull/5050

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:8>

Django

unread,
Jul 27, 2015, 7:30:58 AM7/27/15
to django-...@googlegroups.com
#25110: A test in test_runner fails in isolation
-------------------------------------+-------------------------------------

Reporter: double-y | Owner: JMGordon
Type: Bug | Status: assigned
Component: Testing framework | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for
| checkin

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by timgraham):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:9>

Django

unread,
Jul 27, 2015, 7:35:39 AM7/27/15
to django-...@googlegroups.com
#25110: A test in test_runner fails in isolation
-------------------------------------+-------------------------------------
Reporter: double-y | Owner: JMGordon
Type: Bug | Status: closed

Component: Testing framework | Version: master
Severity: Normal | Resolution: fixed

Keywords: | Triage Stage: Ready for
| checkin
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0

Easy pickings: 0 | UI/UX: 0
-------------------------------------+-------------------------------------
Changes (by Tim Graham <timograham@…>):

* status: assigned => closed
* resolution: => fixed


Comment:

In [changeset:"199a02d1e2adef39b6346a254b097c9ac64a9ec4" 199a02d1]:
{{{
#!CommitTicketReference repository=""
revision="199a02d1e2adef39b6346a254b097c9ac64a9ec4"
Fixed #25110 -- Fixed a test_runner test isolation regression.

Thanks claudep for the patch.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:10>

Reply all
Reply to author
Forward
0 new messages