Skip to content

Commit

Permalink
Adjust deprecation warning for expected kwargs
Browse files Browse the repository at this point in the history
  • Loading branch information
mshriver committed Dec 13, 2023
1 parent 34ae24a commit bfde7da
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/navmazing/_navigator.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,12 @@ def navigate(
stacklevel=2,
)

if args or kwargs:
allowed = ["use_resetter", "wait_for_view"]
if (args and not set(args).issubset(allowed)) or (kwargs and not set(kwargs.keys()).issubset(allowed)):
args_str = ", ".join(
chain(
map(repr, args),
(f"{key}={value!r}" for key, value in kwargs.items()),
map(repr, [a for a in args if a not in allowed]),
(f"{key}={value!r}" for key, value in kwargs.items() if key not in allowed),
)
)
warnings.warn(
Expand Down

0 comments on commit bfde7da

Please sign in to comment.