Quantcast
Channel: User Chase Seibert - Stack Overflow
Viewing all articles
Browse latest Browse all 43

Django-nose --with-profile getting no results ("0 function calls")

$
0
0

I'm trying to diagnose some slow running unit tests, but I'm not having any luck getting the profiler working with django-nose. I came up with a repo case on a brand new Django project.

django-admin.py startproject nosetestcd nosetest/virtualenv --no-site-packages --distribute virtualenvsource virtualenv/bin/activatepip install django_noseecho "DATABASES = {'default': {'ENGINE': 'django.db.backends.sqlite3','NAME': ':memory',    },}INSTALLED_APPS = INSTALLED_APPS + ('django_nose', )TEST_RUNNER = 'django_nose.NoseTestSuiteRunner'">> nosetest/settings.pyecho "import unittestimport timeclass SlowTestCase(unittest.TestCase):    def test_slow(self):        self.assertFalse(time.sleep(1))"> nosetest/test.pypython manage.py test --with-profile

This should create a new Django project in the current directory, install some dependencies in a virtualenv, create a valid settings.py and then run a new unit test.

I'm expecting to see various function calls in the output. Instead, I'm getting the following:

nosetests --verbosity 1 --with-profileCreating test database for alias 'default'....         0 function calls in 0.000 seconds   Ordered by: cumulative time   ncalls  tottime  percall  cumtime  percall filename:lineno(function)        0    0.000             0.000          profile:0(profiler)----------------------------------------------------------------------Ran 1 test in 1.002sOKDestroying test database for alias 'default'...

I have tried the cProfiler with nose-cprof, but that is giving similar results. Can anyone get this same project working, or point me to another solution for profiling this test?


Viewing all articles
Browse latest Browse all 43

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>