Skip to content

Commit

Permalink
Revert "skip CLI options that will confuse typer"
Browse files Browse the repository at this point in the history
This reverts commit c575b10.
  • Loading branch information
avaldebe committed Mar 20, 2023
1 parent 7e4d483 commit 2e43045
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 5 deletions.
8 changes: 4 additions & 4 deletions airbase/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@
from . import __version__
from .airbase import AirbaseClient

main = typer.Typer(no_args_is_help=True, add_completion=False)
main = typer.Typer(
no_args_is_help=True,
add_completion=False,
)
client = AirbaseClient()


Expand All @@ -30,9 +33,6 @@ class Pollutant(str, Enum):

Pollutant = vars()
for poll in client._pollutants_ids:
if poll.upper() in set(Pollutant):
# skipp options that will confuse typer
continue
Pollutant[poll] = poll

def __str__(self) -> str:
Expand Down
6 changes: 5 additions & 1 deletion tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,13 @@ def test_version(options: str):
result = runner.invoke(main, options.split())
assert result.exit_code == 0
assert "airbase" in result.output
assert str(__version__) in result.output
assert __version__ in result.output


@pytest.mark.xfail(
reason="typer has problems with Enum cases https://github.com/tiangolo/typer/discussions/570",
strict=True,
)
def test_CO_vs_Co():
app = Typer()

Expand Down

0 comments on commit 2e43045

Please sign in to comment.