Skip to content

Get session duration from terminal reporter #10147

Answered by The-Compiler
BeyondEvil asked this question in Q&A
Discussion options

You must be logged in to vote

Do you need the exact same time as the one printed by pytest? If not, you can probably just implement pytest_sessionstart and pytest_sessionfinish like the terminalreporter does (or perhaps a hookwrapper around pytest_cmdline_main if you just want one function?), and then use time.time() there to get the time yourself. Should only be off by whatever time the terminalreporter needs itself.

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@BeyondEvil
Comment options

Answer selected by nicoddemus
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants