Skip to content

Conversation

@ionelmc
Copy link
Member

@ionelmc ionelmc commented Mar 31, 2025

No description provided.

"""Base class for different plugin implementations."""

def __init__(self, cov_source, cov_report, cov_config, cov_append, cov_branch, config=None, nodeid=None):
cov: coverage.Coverage | None
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perhaps move this into the initializer? Any reason to have it right here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's just a type annotation - ":" doesn't assign anything to the "cov" class attribute. I added it mostly to make some things easier in my editor.

def __init__(self, cov_source, cov_report, cov_config, cov_append, cov_branch, config=None, nodeid=None):
cov: coverage.Coverage | None

def __init__(self, cov_source, cov_report, cov_config, cov_append, cov_branch, cov_precision, config=None, nodeid=None):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It's probably best to make the new arg last + maybe kw-only so that it isn't a breaking change in the signature.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well now that you mention it, it does look odd doesn't it. Such a large number of positional always leads to some trouble. Funny thing, the config and nodeid are always passed. It was like that since the first commit where this was set to be a common lib for both pytest and nose: 7c6448d

…ore clarity. The config/nodeid were never meant to be optional for this internal class - the intention there was to signal that they can be None values.
@ionelmc ionelmc force-pushed the report-use-cli-precision branch from 30dcf1d to 2e9d704 Compare April 1, 2025 10:30
@ionelmc ionelmc merged commit aa57aed into master Apr 1, 2025
56 checks passed
@ionelmc ionelmc deleted the report-use-cli-precision branch April 5, 2025 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants