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

slash.add_error fails on TypeError when it outside test scope #700

Closed
ayalash opened this issue Dec 3, 2017 · 0 comments
Closed

slash.add_error fails on TypeError when it outside test scope #700

ayalash opened this issue Dec 3, 2017 · 0 comments
Assignees
Milestone

Comments

@ayalash
Copy link
Collaborator

ayalash commented Dec 3, 2017

Failure Traceback:

Session error caught -- TypeError: issubclass() arg 1 must be a class

[2017-12-03 10:33:34] Unexpected error occurred
Traceback (most recent call last):
  File "/home/ayalas/src/github/slash/slash/frontend/slash_run.py", line 68, in slash_run
    run_tests(collected)
  File "/usr/lib/python3.6/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/home/ayalas/src/github/slash/slash/core/session.py", line 133, in get_started_context
    hooks.session_end()  # pylint: disable=no-member
  File "/home/ayalas/virtualenvs/env3.6/lib/python3.6/site-packages/gossip/hooks.py", line 92, in __call__
    return self.trigger(kwargs)
  File "/home/ayalas/virtualenvs/env3.6/lib/python3.6/site-packages/gossip/hooks.py", line 213, in trigger
    break
  File "/usr/lib/python3.6/contextlib.py", line 88, in __exit__
    next(self.gen)
  File "/home/ayalas/virtualenvs/env3.6/lib/python3.6/site-packages/gossip/exception_policy.py", line 18, in context
    self._handle_trigger_end(ctx)
  File "/home/ayalas/virtualenvs/env3.6/lib/python3.6/site-packages/gossip/exception_policy.py", line 36, in _handle_trigger_end
    reraise(exc_type, exc_value, exc_tb)
  File "/home/ayalas/virtualenvs/env3.6/lib/python3.6/site-packages/gossip/_compat.py", line 54, in reraise
    raise value
  File "/home/ayalas/virtualenvs/env3.6/lib/python3.6/site-packages/gossip/hooks.py", line 222, in _call_registration
    registration(**kwargs)
  File "/home/ayalas/virtualenvs/env3.6/lib/python3.6/site-packages/gossip/registration.py", line 75, in __call__
    return self.func(*args, **kwargs)
  File "/tmp/testme.py", line 7, in _callback
    add_error('session: add_error')
  File "/home/ayalas/src/github/slash/slash/utils/__init__.py", line 52, in add_error
    return context.session.results.current.add_error(msg, frame_correction=frame_correction+1, exc_info=exc_info)
  File "/home/ayalas/src/github/slash/slash/core/result.py", line 204, in add_error
    context.reporter.report_test_error_added(context.test, err)
  File "/home/ayalas/src/github/slash/slash/reporting/console_reporter.py", line 385, in report_test_error_added
    self._report_test_error_failure_added(test, error, 'E')
  File "/home/ayalas/src/github/slash/slash/reporting/console_reporter.py", line 392, in _report_test_error_failure_added
    if not issubclass(e.exception_type, CLI_ABORT_EXCEPTIONS):
TypeError: issubclass() arg 1 must be a class
ERROR: Unexpected error: issubclass() arg 1 must be a class

Reproduces by:

from stokado.io.utils import report_exception
from slash import add_error, hooks

@hooks.session_end.register
def _callback():
     add_error('session: add_error')
 
def test_a():
    pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants