Skip to content

Commit 46b93b7

Browse files
authored
Fix warning scheduler_executor without scheduler (#249)
* Fix warning scheduler_executor without scheduler
1 parent 0805c6b commit 46b93b7

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

UnleashClient/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ def __init__(
141141
"If using a custom scheduler, you must specify a executor."
142142
)
143143
else:
144-
if not scheduler:
144+
if not scheduler and scheduler_executor:
145145
LOGGER.warning(
146146
"scheduler_executor should only be used with a custom scheduler."
147147
)

tests/unit_tests/test_client.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ def test_multiple_instances_no_warnings_or_errors_with_different_client_configs(
706706
UnleashClient(
707707
URL, "some-probably-unique-but-different-app-name", refresh_interval="60"
708708
)
709-
assert not all(
709+
assert not any(
710710
["Multiple instances has been disabled" in r.msg for r in caplog.records]
711711
)
712712

@@ -722,7 +722,7 @@ def test_multiple_instances_are_unique_on_api_key(caplog):
722722
"some-probably-unique-app-name",
723723
custom_headers={"Authorization": "hamsters"},
724724
)
725-
assert not all(
725+
assert not any(
726726
["Multiple instances has been disabled" in r.msg for r in caplog.records]
727727
)
728728

0 commit comments

Comments
 (0)