Skip to content

PYTEST_ADDOPTS=--cov pytest test_foo.py #4265

@blueyed

Description

@blueyed

pytest-cov has an argument with nargs='?': https://github.com/pytest-dev/pytest-cov/blob/7205428bfb9ab9f8dbcaeefe23ce5fe426bb06b9/src/pytest_cov/plugin.py#L55-L58

I've just noticed that with PYTEST_ADDOPTS=--cov pytest foo "foo" becomes the arg for it, which really confused me.

It looks like the PYTEST_ADDOPTS handling injects the value, but it should get handled separately/isolated.

Metadata

Metadata

Assignees

No one assigned

    Labels

    topic: configrelated to config handling, argument parsing and config filetype: bugproblem that needs to be addressed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions