From 350ecda3aec3d3bb2962a409990f7bf460e349ff Mon Sep 17 00:00:00 2001 From: Illia Halatiuk Date: Sun, 7 Apr 2024 09:59:43 +0700 Subject: [PATCH] Move blocking test flag to internals --- src/tapper/__init__.py | 5 +++-- tests/integration/conftest.py | 3 ++- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/tapper/__init__.py b/src/tapper/__init__.py index 3ef3f10..9ebafa9 100644 --- a/src/tapper/__init__.py +++ b/src/tapper/__init__.py @@ -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.""" @@ -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. @@ -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) diff --git a/tests/integration/conftest.py b/tests/integration/conftest.py index f0c7506..fa8a846 100644 --- a/tests/integration/conftest.py +++ b/tests/integration/conftest.py @@ -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