Skip to content

The tool.coverage.coverage_conditional_plugin.omit example in the README does not work #224

Closed
@fohrloop

Description

@fohrloop

Thanks for the awesome tool! I think the README has a small mistake in the example configuration.

This

[tool.coverage.coverage_conditional_plugin.omit]
# Here we specify files to conditionally omit:
"my_project/omit*.py" = "sys_platform == 'win32'"

produces

Exception during conditional coverage evaluation: Traceback (most recent call last):
  File "/home/niko/code/myproj/.tox/py37/lib/python3.7/site-packages/coverage_conditional_plugin/__init__.py", line 159, in _should_be_applied
    return eval(code, env_info)  # noqa: WPS421, S307
  File "<string>", line 1
    my_project/omit*.py
                   ^
SyntaxError: invalid syntax

This, on the other hand, works:

[tool.coverage.coverage_conditional_plugin.omit]
# Here we specify files to conditionally omit:
"sys_platform == 'win32'" = "my_project/omit*.py" 

tested on coverage-conditional-plugin 0.9.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions