You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
from my_package.cli import console
import click.testing
import pytest
@pytest.fixture
def cli_runner():
"""Return Click test runner."""
return click.testing.CliRunner()
def test_main_succeeds(cli_runner) -> None:
"""Test main exists withtout errors."""
result = cli_runner.invoke(console.main)
assert result.exit_code == 0
The above snippets should produce the warning when tested with pytest.
Expected behavior
No warning
Additional context
What leads me to believe this might be a bug is that if I change the function like so:
import click
from . import __version__
@click.command()
@click.version_option(version=__version__)
def main(): ############## Notice no "-> None:"
"""Hello description."""
click.echo("Hello, world!")
The warning disapears.
I tried googling around for the warning but I could not find anything useful. Hopefully this is really a bug and not just me not understanding how to use this tool.
The text was updated successfully, but these errors were encountered:
I think this warning is a fix (#190) to highlight limitations when using click and typeguard instead of treating it as an error. #191 (comment) explains the issue in detail.
Describe the bug
I am running typeguard with pytest and get the following warning at the end:
To Reproduce
Have a function like this:
And test like this:
The above snippets should produce the warning when tested with pytest.
Expected behavior
No warning
Additional context
What leads me to believe this might be a bug is that if I change the function like so:
The warning disapears.
I tried googling around for the warning but I could not find anything useful. Hopefully this is really a bug and not just me not understanding how to use this tool.
The text was updated successfully, but these errors were encountered: