Skip to content

Customizing FileHandler of LoggingPlugin from hook #4707

@mitzkia

Description

@mitzkia

Which hook is the best to customizing FileHandler of LoggingPlugin with the name of the testcase?
My goal is to create separate logfiles for each testcases (filename should contains name of the testcase).

Already tried:

  • pytest_report_header(): I can overwrite FileHandler of LoggingPlugin, but the testcase information is not yet exist (I would need name of the testcase from: request.node.originalname)
  • pytest_runtest_logstart(): I have got name of the testcase, but when I try to overwrite the FileHandler of LoggingPlugin it will take no effect.

Metadata

Metadata

Assignees

No one assigned

    Labels

    plugin: loggingrelated to the logging builtin plugintype: enhancementnew feature or API change, should be merged into features branch

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions