[PKG-Openstack-devel] Bug#802677: AttributeError: 'IntegrityError' object has no attribute '__traceback__'

Neil Williams codehelp at debian.org
Thu Oct 22 14:31:17 UTC 2015


Package: python-testtools
Version: 1.8.0-3
Severity: important

python-testtools introduces a bug which causes the failure of all django unit tests
for my package. The full traceback is:

Traceback (most recent call last):
  File "./lava_server/manage.py", line 137, in <module>
    legacy_main()
  File "./lava_server/manage.py", line 133, in legacy_main
    execute_from_command_line(sys.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 385, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python2.7/dist-packages/django/core/management/__init__.py", line 377, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 50, in run_from_argv
    super(Command, self).run_from_argv(argv)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 288, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 71, in execute
    super(Command, self).execute(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/base.py", line 338, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python2.7/dist-packages/django/core/management/commands/test.py", line 88, in handle
    failures = test_runner.run_tests(test_labels)
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 148, in run_tests
    result = self.run_suite(suite)
  File "/usr/lib/python2.7/dist-packages/django/test/runner.py", line 115, in run_suite
    ).run(suite)
  File "/usr/lib/python2.7/unittest/runner.py", line 151, in run
    test(result)
  File "/usr/lib/python2.7/unittest/suite.py", line 70, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/unittest/suite.py", line 108, in run
    test(result)
  File "/usr/lib/python2.7/dist-packages/unittest2/case.py", line 673, in __call__
    return self.run(*args, **kwds)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 606, in run
    return run_test.run(result)
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 80, in run
    return self._run_one(actual_result)
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 94, in _run_one
    return self._run_prepared_result(ExtendedToOriginalDecorator(result))
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 108, in _run_prepared_result
    self._run_core()
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 144, in _run_core
    self.case._run_test_method, self.result):
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 193, in _run_user
    return self._got_user_exception(sys.exc_info())
  File "/usr/lib/python2.7/dist-packages/testtools/runtest.py", line 213, in _got_user_exception
    self.case.onException(exc_info, tb_label=tb_label)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 556, in onException
    self._report_traceback(exc_info, tb_label=tb_label)
  File "/usr/lib/python2.7/dist-packages/testtools/testcase.py", line 592, in _report_traceback
    self, '__testtools_tb_locals__', False)))
  File "/usr/lib/python2.7/dist-packages/testtools/content.py", line 205, in __init__
    limit=limit, capture_locals=capture_locals).format())
  File "/usr/lib/python2.7/dist-packages/traceback2/__init__.py", line 449, in __init__
    exc_value.__cause__.__traceback__,
AttributeError: 'IntegrityError' object has no attribute '__traceback__'

Downgrading python-testtools to 0.9.39-2 - with no other changes - completely fixes the problem.

This happens with all calls to the django unit tests using manage.py test.

ii  python-django                 1.7.10-1  

To reproduce, it is necessary to install lava-server, so a Stretch VM is recommended.
This provides the django environment and migrations:

$ echo "Accept defaults for debconf prompts"
$ sudo apt -y install lava-server lava-dev
$ git clone http://git.linaro.org/lava/lava-server.git
$ cd lava-server
$ git checkout release
$ ./ci-run -v2

To call unit tests individually, use:
$ ./lava_server/manage.py test <app_name>

where <app_name> is one of dashboard_app, lava_scheduler_app, lava_scheduler_daemon or lava_results_app.

-- System Information:
Debian Release: stretch/sid
  APT prefers unstable
  APT policy: (500, 'unstable'), (500, 'testing'), (500, 'stable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Foreign Architectures: i386, armhf, arm64

Kernel: Linux 4.1.0-2-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_GB.utf8, LC_CTYPE=en_GB.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

Versions of packages python-testtools depends on:
ii  python                2.7.9-1
ii  python-extras         0.0.3-3
ii  python-mimeparse      0.1.4-1
ii  python-pkg-resources  18.4-1

Versions of packages python-testtools recommends:
ii  python-fixtures  1.3.1-2

Versions of packages python-testtools suggests:
pn  python-testtools-doc  <none>
ii  python-twisted        15.2.1-1

-- no debconf information



More information about the Openstack-devel mailing list