[Solved]-Py.test: Show local variables in Jenkins

10👍

Use -l/--showlocals option:

pytest --showlocals # show local variables in tracebacks
pytest -l           # show local variables (shortcut)

example:

    def foo():
        a = 1
>       assert 0
E       assert 0

a          = 1

test_foo.py:8: AssertionError

see more details in the doc.

Leave a comment