Installing south and using sqlite3's :memory: ruins total test suite time

24 views
Skip to first unread message

Peter Bengtsson

unread,
Jan 20, 2015, 3:37:44 PM1/20/15
to django...@googlegroups.com
I have a django project on django 1.6. It's using django-nose and it's using sqlite3's :memory: trick:

DATABASES = {
    'default': {
        'ENGINE': 'django.db.backends.sqlite3',
        'NAME': ':memory:',
    }
}

Before I added `south` to INSTALLED_APPS it would take about ~5 seconds to run the 371 tests.

So I add `south` to INSTALLED_APPS (and make sure django_nose is mentioned last) and I also set SOUTH_TESTS_MIGRATE=False (meaning I can put things in the the 0001_initial.py files and it doesn't get executed).

Now it takes ~50 seconds to run the whole test suite. That's 10x times slower! :(

I ran the tests with nose-timer and it basically seems every test now gets a lot slower. You can compare https://gist.github.com/peterbe/34c9b14028d63429491c with https://gist.github.com/peterbe/9202c20edee964a370d3


Anybody know what's causing South (1.0.2) to make everything so much slower?

Peter Bengtsson

unread,
Jan 20, 2015, 4:25:33 PM1/20/15
to django...@googlegroups.com
Quick update there,
I've figured out where the time is spent. Those ~45 seconds is caused by django_compressor calling out to `lessc` to convert .less files to .css.

I'm now trying to figure out why having south in INSTALLED_APPS changes whether that gets run or not. It shouldn't run anything in runtime because I have `COMPRESS_OFFLINE = True` on and I run compress before running tests.

Peter Bengtsson

unread,
Jan 20, 2015, 4:34:38 PM1/20/15
to django...@googlegroups.com
It seems, for some reason settings.COMPRESS_ENABLED gets set to False when south is installed.

On Tuesday, January 20, 2015 at 12:37:44 PM UTC-8, Peter Bengtsson wrote:
Reply all
Reply to author
Forward
0 new messages