Skip to content

Unhandled exception when running from master #20

@mbednarski

Description

@mbednarski

Hello

//For first, thanks for this piece of software - it's really useful for me

I have issue with up-to-date master branch. When I run my tests I receive following error:

pyfuncitem = <Function test_parse_header_assume[data/raw/AuditTrail__20140226_103919.PDF-expected6]>

    @pytest.hookimpl(hookwrapper=True)
    def pytest_pyfunc_call(pyfuncitem):
        """
        Using pyfunc_call to be as 'close' to the actual call of the test as possible.
    
        This is executed immediately after the test itself is called.
    
        Note: I'm not happy with exception handling in here.
        """
        __tracebackhide__ = True
        outcome = None
        try:
            outcome = yield
        finally:
            failed_assumptions = _FAILED_ASSUMPTIONS
            assumption_locals = _ASSUMPTION_LOCALS
            if failed_assumptions:
                failed_count = len(failed_assumptions)
                root_msg = "\n%s Failed Assumptions:\n" % failed_count
                if assumption_locals:
                    assume_data = zip(failed_assumptions, assumption_locals)
                    longrepr = ["{0}\nLocals:\n{1}\n\n".format(assumption, "\n".join(flocals))
                                for assumption, flocals in assume_data]
                else:
                    longrepr = ["\n\n".join(failed_assumptions)]
    
                del _FAILED_ASSUMPTIONS[:]
                del _ASSUMPTION_LOCALS[:]
                if outcome and outcome.excinfo:
                    root_msg = "\nOriginal Failure: \n>> %s\n" % repr(outcome.excinfo[1]) + root_msg
                    raise FailedAssumption(root_msg + "".join(longrepr)).with_traceback(outcome.excinfo[2])
                else:
>                   raise FailedAssumption(root_msg + "".join(longrepr))
E                   pytest_assume.plugin.FailedAssumption: 
E                   1 Failed Assumptions:
E                   tests/test_parse_header.py:119: AssumptionFailure
E                   >>	pytest.assume(parsed.rezept == expected.rezept)

../../tmp/pytest-assume/pytest_assume/plugin.py:92: FailedAssumption

My test fails as expected, however not gracefully. For tag 1.2.2 it works as expected:

tests/test_parse_header.py:119: AssumptionFailure
	pytest.assume(parsed.rezept == expected.rezept)

------------------------------------------------------------
Failed Assumptions: 1

As I was able to investigate, the issue was introduced in 649227c

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions