Skip to content

Customize test id on the terminal report #3140

Closed
@fontealpina

Description

@fontealpina

Running pytest with -v option, I am obtaining an output of this type:
ToolTest/test/bug_001/test.py::TestBug001::test_bug_001 <- test.py PASSED
I would like to customize the test id, e.g. removing <- test.py to get:
ToolTest/test/bug_001/test.py::TestBug001::test_bug_001 PASSED

To do this, I tried to write a plugin with the hook:
def pytest_runtest_logstart(nodeid, location):
but seems that my hook is called after the test id has already been printed on the terminal.
So I was wondering if there is a way to do this?

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    type: questiongeneral question, might be closed after 2 weeks of inactivity

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions