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 when using --slowreportpath with Django 3.1 #32

Open
haplo opened this issue Jan 19, 2021 · 1 comment
Open

AttributeError when using --slowreportpath with Django 3.1 #32

haplo opened this issue Jan 19, 2021 · 1 comment

Comments

@haplo
Copy link

haplo commented Jan 19, 2021

I have added django-slow-tests to a Django 3.1-based project. --slowreport works fine, but --slowreportpath is failing with this stacktrace:

$ ./manage.py test --slowreport --slowreportpath=report.json
Creating test database for alias 'default'...
System check identified no issues (0 silenced).
...........................................................................
----------------------------------------------------------------------
Ran 75 tests in 8.603s

OK
Destroying test database for alias 'default'...
Traceback (most recent call last):
  File "./manage.py", line 26, in <module>
    execute_from_command_line(sys.argv)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django/core/management/commands/test.py", line 23, in run_from_argv
    super().run_from_argv(argv)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django/core/management/base.py", line 330, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django/core/management/base.py", line 371, in execute
    output = self.handle(*args, **options)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django/core/management/commands/test.py", line 53, in handle
    failures = test_runner.run_tests(test_labels)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django/test/runner.py", line 712, in run_tests
    return self.suite_result(suite, result)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django_slowtests/testrunner.py", line 260, in suite_result
    self.generate_report(test_results, result)
  File "/home/fidel/Code/solidshape/backend/platform/.venv/lib/python3.8/site-packages/django_slowtests/testrunner.py", line 178, in generate_report
    'nb_tests': result.testsRun,
AttributeError: 'tuple' object has no attribute 'testsRun'
@m-kc
Copy link

m-kc commented May 14, 2021

I'm having the same issue on Django 2.2 + Python 3.7, stack trace appears to be identical aside from line numbers:

Traceback (most recent call last):
  File "./manage.py", line 9, in <module>
    execute_from_command_line(sys.argv)
  File "{{...}}/lib/python3.7/site-packages/django/core/management/__init__.py", line 381, in execute_from_command_line
    utility.execute()
  File "{{...}}/lib/python3.7/site-packages/django/core/management/__init__.py", line 375, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "{{...}}/lib/python3.7/site-packages/django/core/management/commands/test.py", line 23, in run_from_argv
    super().run_from_argv(argv)
  File "{{...}}/lib/python3.7/site-packages/django/core/management/base.py", line 323, in run_from_argv
    self.execute(*args, **cmd_options)
  File "{{...}}/lib/python3.7/site-packages/django/core/management/base.py", line 364, in execute
    output = self.handle(*args, **options)
  File "{{...}}/lib/python3.7/site-packages/test_without_migrations/management/commands/_base.py", line 78, in handle
    super(CommandMixin, self).handle(*test_labels, **options)
  File "{{...}}/lib/python3.7/site-packages/django/core/management/commands/test.py", line 53, in handle
    failures = test_runner.run_tests(test_labels)
  File "{{...}}/lib/python3.7/site-packages/django/test/runner.py", line 646, in run_tests
    return self.suite_result(suite, result)
  File "{{...}}/lib/python3.7/site-packages/django_slowtests/testrunner.py", line 260, in suite_result
    self.generate_report(test_results, result)
  File "{{...}}/lib/python3.7/site-packages/django_slowtests/testrunner.py", line 178, in generate_report
    'nb_tests': result.testsRun,
AttributeError: 'tuple' object has no attribute 'testsRun'

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