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

AttributeError: type object 'BaseCommand' has no attribute 'option_list' #299

Open
kausal-goibibo opened this issue Mar 5, 2019 · 1 comment

Comments

@kausal-goibibo
Copy link

I am on Django==2.0.4. When I add django-nose in INSTALLED_APPS, I get the below error. Please help.
django-nose==1.4.6
nose==1.3.7

/usr/local/python3/bin/python3.6 manage.py help test

Traceback (most recent call last):
File "manage.py", line 12, in
execute_from_command_line(sys.argv)
File "/usr/local/python3/lib/python3.6/site-packages/django/core/management/init.py", line 371, in execute_from_command_line
utility.execute()
File "/usr/local/python3/lib/python3.6/site-packages/django/core/management/init.py", line 347, in execute
django.setup()
File "/usr/local/python3/lib/python3.6/site-packages/django/init.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/usr/local/python3/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
app_config = AppConfig.create(entry)
File "/usr/local/python3/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
module = import_module(entry)
File "/usr/local/python3/lib/python3.6/importlib/init.py", line 126, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 978, in _gcd_import
File "", line 961, in _find_and_load
File "", line 950, in _find_and_load_unlocked
File "", line 655, in _load_unlocked
File "", line 678, in exec_module
File "", line 205, in _call_with_frames_removed
File "/usr/local/python3/lib/python3.6/site-packages/django_nose/init.py", line 5, in
from django_nose.runner import BasicNoseRunner, NoseTestSuiteRunner
File "/usr/local/python3/lib/python3.6/site-packages/django_nose/runner.py", line 285, in
class BaseRunner(DiscoverRunner):
File "/usr/local/python3/lib/python3.6/site-packages/django_nose/runner.py", line 287, in BaseRunner
options = _get_options()
File "/usr/local/python3/lib/python3.6/site-packages/django_nose/runner.py", line 143, in _get_options
django_opts = [opt.dest for opt in BaseCommand.option_list] + ['version']
AttributeError: type object 'BaseCommand' has no attribute 'option_list'

@jwhitlock
Copy link
Contributor

That code was removed in django-nose 1.4.4. Can you try re-installing django-nose 1.4.6?

These should both show (1, 4, 6) for the installed version:


/usr/local/python3/bin/python3.6 -c "import django_nose; print(django_nose.VERSION)"
/usr/local/python3/bin/python3.6 ./manage.py shell -c "import django_nose; print(django_nose.VERSION)"

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

2 participants