Skip to content

Teardown log not shown in html #145

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

Closed
PhilippSelenium opened this issue Feb 8, 2018 · 3 comments
Closed

Teardown log not shown in html #145

PhilippSelenium opened this issue Feb 8, 2018 · 3 comments

Comments

@PhilippSelenium
Copy link

The teardown log is not shown in the html despite being shown on the cmd line.

@davehunt
Copy link
Collaborator

davehunt commented Feb 9, 2018

Please provide more details, as this feature is working fine for me. If you can reproduce with a simple test case, that would be ideal. Thanks!

@PhilippSelenium
Copy link
Author

PhilippSelenium commented Feb 9, 2018

pytest: 3.4.0
pytest-html: 1.16.1

conftest.py

import pytest
import logging

@pytest.fixture(autouse=True)
def foo_fixture():
    logger = logging.getLogger("foo")
    logger.info("Setup")

    yield

    logger.info("Teardown")

test.py

import logging

class TestFoo(object):

    def test_bar(self):

        logger = logging.getLogger("foo")
        logger.debug("Call")
        raise AssertionError()

Execution:
pytest -v test.py --html=report.html --log-level=10

  1. stdout shows log for setup, call, and teardown

  2. output of html:

test.py:10: AssertionError
------------------------------ Captured log setup ------------------------------
conftest.py 9 INFO Setup------------------------------ Captured log call -------------------------------
test.py 9 DEBUG Call

@davehunt
Copy link
Collaborator

Thank you, your additional information demonstrated that this in fact is fixture related setup/teardown. This is a duplicate of #131 and I'd be happy to review any patches that add this functionality.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants