Skip to content

Conversation

@bluetech
Copy link
Member

Extracted from #6717.

Annotate some "easy" arguments of hooks that repeat in a lot of internal plugins.

Not all of the arguments are annotated fully for now.

def pytest_configure(config):
config.cache = Cache.for_config(config)
def pytest_configure(config: Config) -> None:
# Type ignored: pending mechanism to store typed objects scoped to config.
Copy link
Member Author

Choose a reason for hiding this comment

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

This repeats in several plugins. I have a simple plan for how to do it, but for now I added type-ignores.


log_file = get_option_ini(config, "log_file")
if log_file:
if not log_file:
Copy link
Member Author

Choose a reason for hiding this comment

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

Swapped the order so mypy can infer the type without an annotation.

Annotate some "easy" arguments of hooks that repeat in a lot of internal
plugins.

Not all of the arguments are annotated fully for now.
@bluetech bluetech closed this Feb 28, 2020
@bluetech bluetech deleted the hooks-annotate-1 branch February 28, 2020 12:08
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.

2 participants