django-nose icon indicating copy to clipboard operation
django-nose copied to clipboard

running ./manage.py test runs dist-package/nose/case.py

Open brianwu02 opened this issue 10 years ago • 7 comments

running ./manage.py test fails on these given tests. Does anyone know if this is because I am importing these tests somewhere and it is running them? Any explanations as to why these tests are running and/or failing would be helpful. thanks.

ERROR: Construct a test case with the specified label. Label should be of the

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest self.test(_self.arg) File "/usr/local/lib/python2.7/dist-packages/nose/util.py", line 619, in newfunc return func(_arg, **kw) TypeError: build_test() takes exactly 1 argument (0 given)

ERROR: Creates a test database, prompting the user for confirmation if the

Traceback (most recent call last): File "/usr/local/lib/python2.7/dist-packages/nose/case.py", line 197, in runTest self.test(*self.arg) TypeError: create_test_db() takes at least 1 argument (0 given)


brianwu02 avatar Sep 16 '14 16:09 brianwu02

I'm getting that same error as you for the first test, and this is the only Google hit for it. Did you figure anything out?

EDIT: Figured out what was going on in my case, sort of. I had a custom test runner, and when nose was trying to test it it raised this error.

bjornkri avatar Oct 15 '14 21:10 bjornkri

unfortunately not :/

On Oct 15, 2014, at 5:44 PM, Björn Kristinsson [email protected] wrote:

I'm getting that same error as you for the first test, and this is the only Google hit for it. Did you figure anything out?

— Reply to this email directly or view it on GitHub.

brianwu02 avatar Oct 16 '14 16:10 brianwu02

It's running build_test() and create_test_db(). Mark these with nose.tools.nottest.

mbertheau avatar Oct 22 '14 12:10 mbertheau

Any way to figure out why it’s executing tests for nose itself? id rather not reach in to the library and modify the source.

On Oct 22, 2014, at 8:53 AM, Markus Bertheau [email protected] wrote:

brianwu02 avatar Oct 22 '14 17:10 brianwu02

These functions are not tests for nose. They are functions in nose/django. You need to figure out where nose found these functions. Maybe you imported them by accident into a test module?

Without more information or code that's all I can say.

mbertheau avatar Oct 23 '14 02:10 mbertheau

Hi, I don't know if this is information is still useful but it turns out we we running django_nose tests because we subclassed NoseTestSuiteRunner in our TestSuiteRunner

We had the following:

from django_nose import NoseTestSuiteRunner

class TestSuiteRunner(NoseTestSuiteRunner):
    blah

Don't subclass and issue goes away.

brianwu02 avatar Jan 21 '15 16:01 brianwu02

Smells similar to #209.

jwhitlock avatar Jul 02 '15 21:07 jwhitlock