Skip to content

Commit

Permalink
Move blocking test flag to internals
Browse files Browse the repository at this point in the history
  • Loading branch information
IGalat committed Apr 7, 2024
1 parent 574b594 commit 350ecda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/tapper/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

_send_processor = _SendCommandProcessor.from_none()
_initialized = False
_blocking = True

Tap = _tap_tree.Tap
"""Trigger-action plan. Main part of this library. Allows setting hotkeys."""
Expand Down Expand Up @@ -58,7 +59,7 @@ def init() -> None:
_initialized = True


def start(blocking: bool = True) -> None:
def start() -> None:
"""
Initializes all underlying tools, and starts listeners.
No changes by user in any elements of tapper are expected after this command.
Expand All @@ -72,6 +73,6 @@ def start(blocking: bool = True) -> None:

# Should be blocking for normal usage, flag is for testing.
# If tray icon is on, it will be blocking anyway.
if blocking:
if _blocking:
while True:
_time.sleep(1000000)
3 changes: 2 additions & 1 deletion tests/integration/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ def start() -> None:
real_sender.kb_controller = kbc
real_sender.mouse_controller = mc

tapper.start(False)
tapper._blocking = False
tapper.start()

fixture.start = start # type: ignore

Expand Down

0 comments on commit 350ecda

Please sign in to comment.