Skip to content

Commit

Permalink
Rm global use in test
Browse files Browse the repository at this point in the history
  • Loading branch information
maldoinc committed Oct 6, 2024
1 parent 60fa33c commit 773f688
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions test/integration/test_fastapi_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,15 @@

from test.unit.services.no_annotations.random.random_service import RandomService

is_lucky_number_invoked = False


def get_lucky_number() -> int:
global is_lucky_number_invoked # noqa: PLW0603

# Raise if this will be invoked more than once
# That would be the case if wireup also "unwraps" and tries
# to resolve dependencies it doesn't own.
if is_lucky_number_invoked:
if hasattr(get_lucky_number, "_called"):
raise Exception("Lucky Number was already invoked")

is_lucky_number_invoked = True
get_lucky_number._called = True
return 42


Expand Down

0 comments on commit 773f688

Please sign in to comment.