Re: TransactionTestCase and Fixture Teardown

2011-07-11 Thread Ramiro Morales
On Mon, Jul 11, 2011 at 6:52 PM, David Cramer  wrote:
> We're currently in the process of converting from unittest (pure) to
> Nose, and one of the issues I've noticed while doing this was that the
> database wasn't flushing correctly when switching from a
> TransactionTestCase to a TestCase. I've been digging through the code
> this morning, and I honestly can't even figure out how this would work
> in the standard test suite (excluding nose).

For our test runner it seems test case [1][2]reordering works in a way
so the TransactionTestCase's go to a bucket after the TestCase's even
when you specify an opposite explicit order. e.g.:

$ ~/django_test/pg83
backends.FkConstraintsTests.test_integrity_checks_on_creation
basic.ModelTest.test_object_creation -v2
[...]
test_object_creation (modeltests.basic.tests.ModelTest) ... ok
test_integrity_checks_on_creation
(regressiontests.backends.tests.FkConstraintsTests) ... ok

--
Ran 2 tests in 1.031s

So there isn't possibility of a TestCase being run after a
TransactionTestCase with our test infrastructure.  I can't say this is
by design or a result of gradual evolution of our test support code.
That's why I'm leaving this note here just in case we want to revisit
this at some point (although I suspect adding a flush at the end of
every test case for MySQL+MyISAM  TransactionTestCase will make it even
slower).

-- 
Ramiro Morales


1. 
https://code.djangoproject.com/browser/django/trunk/django/test/simple.py#L172
2. 
https://code.djangoproject.com/browser/django/trunk/django/test/simple.py#L252

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.



TransactionTestCase and Fixture Teardown

2011-07-11 Thread David Cramer
We're currently in the process of converting from unittest (pure) to
Nose, and one of the issues I've noticed while doing this was that the
database wasn't flushing correctly when switching from a
TransactionTestCase to a TestCase. I've been digging through the code
this morning, and I honestly can't even figure out how this would work
in the standard test suite (excluding nose).

I can't imagine this is an actual bug, or that it only came up for
Nose, so I'm hoping someone can explain if there is magic somewhere in
here, and where it is. Otherwise I suppose I can file an awful ticket
to add flush to the teardown step as well (which is what I temporarily
did to move past this problem).

-- 
You received this message because you are subscribed to the Google Groups 
"Django users" group.
To post to this group, send email to django-users@googlegroups.com.
To unsubscribe from this group, send email to 
django-users+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/django-users?hl=en.