{{{
% ./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.
* 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>
* status: new => assigned
* cc: JMGordon (added)
* owner: nobody => JMGordon
--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:2>
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>
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>
Comment (by JMGordon):
Yes, still interested. I'll test it out.
--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:5>
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>
Comment (by claudep):
Yes, please.
--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:7>
Comment (by JMGordon):
Made pull request:
https://github.com/django/django/pull/5050
--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:8>
* stage: Accepted => Ready for checkin
--
Ticket URL: <https://code.djangoproject.com/ticket/25110#comment:9>
* 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>