Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot use pyzen with nosetests in a django app #3

Open
sharebear opened this issue Jul 2, 2011 · 10 comments
Open

Cannot use pyzen with nosetests in a django app #3

sharebear opened this issue Jul 2, 2011 · 10 comments

Comments

@sharebear
Copy link

Hi,

I just tried starting a new django project using django-nose together with pyzen however python manage.py zen just crashes with the following exception

$ python myproject/manage.py zen
nosetests --verbosity 1
Traceback (most recent call last):
File "/Users/jshare/Source/myproject/env/lib/python2.6/site-packages/pyzen/core.py", line 79, in run
result = self.func(_self.args, *_self.kwargs)
File "/Users/jshare/Source/myproject/env/lib/python2.6/site-packages/pyzen/management/commands/zen.py", line 32, in run_tests
result = test_runner.run_tests(test_labels)
File "/Users/jshare/Source/myproject/env/lib/python2.6/site-packages/django_nose/runner.py", line 85, in run_tests
result = self.run_suite(nose_argv)
File "/Users/jshare/Source/myproject/env/lib/python2.6/site-packages/pyzen/management/commands/zen.py", line 27, in run_suite
return get_test_runner(nocolor)(verbosity=self.verbosity).run(suite)
File "/Users/jshare/Source/myproject/env/lib/python2.6/site-packages/pyzen/runner.py", line 54, in run
test(result)
TypeError: 'list' object is not callable

Looking at the code for the zen command implementation I can see that this unlikely to work with the current implementation as you end up overriding the run_suite method from NoseTestSuiteRunner https://github.com/jbalogh/django-nose/blob/master/django_nose/runner.py

It's a little late in the day here so I'm struggling to see a way to get these two runners to play together. Any ideas on how I could get this dream setup to work?

Regards,

Jonathan

@coderanger
Copy link
Owner

Hmm, so I could change it so that --nocolor uses the super-classes test runner I think (the runner it injects just adds color coding). Not sure if there was a specific reason I had to not use the normal Django runner.

@coderanger
Copy link
Owner

Really the better answer is that django-nose shouldn't alter the semantics of run_suite :-(

@sharebear
Copy link
Author

I've read the documentation of run_suite and I don't see how django-nose is changing the semantics. It feels more to me that pyzen is making an invalid assumption.

From what I can tell pyzen is only overriding the test runner in order to add the colourising so you could just skip the overriding if nocolor is specified. Would this solve my problem?

@coderanger
Copy link
Owner

The change in semantics is that the thing django-nose passes to run_suite isn't actually a suite. As for the solution, I think that would work fine in 1.3+ (DjangoTestRunner had some signal stuffs I had to avoid in 1.2 I think). I'll go ahead an add a new option just to be safe.

@BrianHicks
Copy link

has this option been added somewhere? I don't see it in the commits.

@ogirardot
Copy link

i'd love it to work too :) +1

@ogirardot
Copy link

this is still broken on my side, any workaround to this in the meantime ?

@erikrose
Copy link

Just updated django-nose to 1.0. Give it another shot?

@sharebear
Copy link
Author

I just did a quick test and I get the same error "TypeError: 'list' object is not callable"

@krak3n
Copy link

krak3n commented Jun 12, 2012

Also encountering this issue w/:

Django==1.4
PyZen==0.3.2
nose==1.1.2
django-nose==1.1
coverage==3.5.2
specloud==0.4.5
nose-cover3==0.1.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants