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

exception handling error #2

Closed
zvolsky opened this issue Dec 28, 2017 · 1 comment
Closed

exception handling error #2

zvolsky opened this issue Dec 28, 2017 · 1 comment

Comments

@zvolsky
Copy link
Contributor

zvolsky commented Dec 28, 2017

  • django-smoke-tests version: 0.1.4
  • Django version: 2.0
  • Python version: 3.6.4
  • Operating System: Debian 9

Description

While working on the Django 2.0 support (see Pull Request) I had an other error during reporting of some exception.
I don't know if this is django-smoke-tests problem, but I think it could be.
Maybe you will be more familiar with this, so please look to the 2nd half ot the error report bellow (the 2nd AttributeError).
Of course it is nothing too much important.
Best regards, Mirek.

(ve_acatto) mirek@toshiba-deb9:~/w/dj/acatto/acatto$ ./manage.py smoke_tests
Traceback (most recent call last):
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django/core/management/base.py", line 288, in run_from_argv
self.execute(*args, **cmd_options)
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django/core/management/base.py", line 335, in execute
output = self.handle(*args, **options)
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django_smoke_tests/management/commands/smoke_tests.py", line 84, in handle
generator.execute()
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django_smoke_tests/generator.py", line 91, in execute
self.load_all_endpoints(URLResolver(r'^/', settings.ROOT_URLCONF).url_patterns)
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django_smoke_tests/generator.py", line 119, in load_all_endpoints
parent_url + url_pattern.regex.pattern,
AttributeError: 'URLPattern' object has no attribute 'regex'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
File "./manage.py", line 15, in
execute_from_command_line(sys.argv)
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django/core/management/init.py", line 371, in execute_from_command_line
utility.execute()
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django/core/management/init.py", line 365, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/home/mirek/w/dj/acatto/ve_acatto/lib/python3.6/site-packages/django/core/management/base.py", line 290, in run_from_argv
if options.traceback or not isinstance(e, CommandError):
AttributeError: 'Namespace' object has no attribute 'traceback'

@kamilkijak
Copy link
Owner

Thank you for reporting this.

The problem is that in the Django command for smoke tests there is a custom CommandParser applied. Apparently it causes some problems as Django BaseCommand expects some specific arguments in that CommandParser. This time traceback was missing.

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