ArturSpirin/test_junkie

BeforeClass & AfterClass errors dont have proper traceback

ArturSpirin opened this issue · 0 comments

  1. Python version python --version >> 2.7
  2. Test Junkie version pip show test_junkie >> 0.5a2
  3. Platform aka Windows 10 or Linux Mint 18.1 >> all
  4. Command used, if running via terminal >> N/A
  5. Smallest code snippet that can reproduce the issue and /or description of the issue
@Suite()
class Example:

    @beforeClass()
    def before_class(self):
        raise Exception("Find me!")

Expected behaviour

Exception is raised with a usable traceback

Actual behaviour

Traceback (most recent call last):
File "E:\Development\test_junkie\test_junkie\runner.py", line 507, in __run_before_class
    class_parameter=class_parameter)
File "E:\Development\test_junkie\test_junkie\runner.py", line 557, in __process_decorator
    raise decorator_error
Exception: Find me!

Based on this traceback its hard to track where the issue happen in the code because the exception is being raised in the internal function. Instead need to capture the traceback.format_exc() during the exception and raise appropriate exception with the right trace so it can pinpoint exact line in the code with the issue.


If attaching logs, make sure to remove any personal information, credentials, tokens, keys - anything that you don't
want to become public.