Skip to content

pytest-assume prevents captured log/stdout to appear call reports #48

@Sup3rGeo

Description

@Sup3rGeo

Hi,

I think this is a consequence of #42. I remember back in time, I picked pytest-assume instead of pytest-check because of its use of pytest_pyfunc_call, as it would seamlessly integrate with other (reporting) plugins like Allure.

However, with this change to use pytest_runtest_call instead, now we cannot get the captured logs of the call section anymore in the report yielded at pytest_runtest_makereport.

The dummy test run is:

@pytest.fixture
def dummy_fix():
    logging.info("Setup!")
    yield
    logging.info("Teardown!")


@pytest.mark.dummy
def test_dummy_fail_assume(dummy_fix):
    logging.info("Got here sucessfully")
    with assume: assert 1 == 2

This is what I am checking, the report variable:

@pytest.hookimpl(hookwrapper=true)
    def pytest_runtest_makereport(self, item, call):
        report = (yield).get_result()

With pytest_runtest_call I get:

image

With pytest_pyfunc_call I get (manually changing the hook in plugin.py):

image

We can see that in the first case we don't have the logs for the call section.

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