Skip to content
Discussion options

You must be logged in to vote

Hi @dbarbuzzi

The issue is when those arguments are being added.

pytest_load_initial_conftests can modify args, but not every option can safely be introduced there. In particular:

  • -o junit_logging=... / -o junit_log_passing_tests=... are too late because pytest has already processed the ini overrides before this hook finishes.
  • pytest-cov also uses pytest_load_initial_conftests and declares it with tryfirst=True, so adding --cov... from another implementation of the same hook can happen after pytest-cov has already inspected the early options.

That explains why the values can appear later in request.config.option even though the corresponding plugin behavior was never initialized from them.

Replies: 1 comment 1 reply

Comment options

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

Answer selected by dbarbuzzi
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