diff --git a/tests/test_observable/test_blocking/test_blocking.py b/tests/test_observable/test_blocking/test_blocking.py index d6b1686ea..17b8a2c96 100644 --- a/tests/test_observable/test_blocking/test_blocking.py +++ b/tests/test_observable/test_blocking/test_blocking.py @@ -20,11 +20,6 @@ class RxException(Exception): pass -# Helper function for raising exceptions within lambdas -def _raise(ex): - raise RxException(ex) - - class TestBlocking(unittest.TestCase): def test_run_empty(self): with pytest.raises(SequenceContainsNoElementsError): diff --git a/tests/test_observable/test_combinelatest.py b/tests/test_observable/test_combinelatest.py index 361b062a5..b842b3c04 100644 --- a/tests/test_observable/test_combinelatest.py +++ b/tests/test_observable/test_combinelatest.py @@ -18,7 +18,7 @@ class RxException(Exception): # Helper function for raising exceptions within lambdas -def _raise(ex): +def _raise(ex: Exception) -> None: raise RxException(ex) diff --git a/tests/test_observable/test_contains.py b/tests/test_observable/test_contains.py index adbe11782..549641877 100644 --- a/tests/test_observable/test_contains.py +++ b/tests/test_observable/test_contains.py @@ -108,7 +108,7 @@ def test_contains_comparer_throws(self): xs = scheduler.create_hot_observable(on_next(150, 1), on_next(210, 2)) def create(): - def comparer(a, b): + def comparer(a: int, b: int) -> bool: raise Exception(ex) return xs.pipe(ops.contains(42, comparer)) diff --git a/tests/test_observable/test_count.py b/tests/test_observable/test_count.py index 918f0f19a..6a2acbcf9 100644 --- a/tests/test_observable/test_count.py +++ b/tests/test_observable/test_count.py @@ -208,7 +208,7 @@ def test_count_predicate_predicate_throws(self): ) def create(): - def predicate(x): + def predicate(x: int) -> bool: if x == 3: raise Exception(ex) else: diff --git a/tests/test_observable/test_empty.py b/tests/test_observable/test_empty.py index 26a70f14f..dd2f70d6e 100644 --- a/tests/test_observable/test_empty.py +++ b/tests/test_observable/test_empty.py @@ -17,7 +17,7 @@ class RxException(Exception): # Helper function for raising exceptions within lambdas -def _raise(ex): +def _raise(ex: Exception) -> None: raise RxException(ex) diff --git a/tests/test_observable/test_filtering_fluent.py b/tests/test_observable/test_filtering_fluent.py index f99b09b35..829c295f5 100644 --- a/tests/test_observable/test_filtering_fluent.py +++ b/tests/test_observable/test_filtering_fluent.py @@ -728,8 +728,8 @@ def test_single_or_default_async_with_single_element(self) -> None: """Verify single_or_default_async with single element.""" source: Observable[int] = rx.of(42) - fluent_result: Observable[int] = source.single_or_default_async() - pipe_result: Observable[int] = source.pipe(ops.single_or_default_async()) + fluent_result: Observable[int] = source.single_or_default_async() # type: ignore[assignment] + pipe_result: Observable[int] = source.pipe(ops.single_or_default_async()) # type: ignore[assignment] fluent_values: list[int] = [] pipe_values: list[int] = [] @@ -762,8 +762,8 @@ def test_single_or_default_async_with_empty_no_default(self) -> None: """Verify single_or_default_async errors when empty without default.""" source: Observable[int] = rx.empty() - fluent_result: Observable[int] = source.single_or_default_async() - pipe_result: Observable[int] = source.pipe(ops.single_or_default_async()) + fluent_result: Observable[int] = source.single_or_default_async() # type: ignore[assignment] + pipe_result: Observable[int] = source.pipe(ops.single_or_default_async()) # type: ignore[assignment] fluent_errors: list[Exception] = [] pipe_errors: list[Exception] = [] @@ -778,8 +778,8 @@ def test_single_or_default_async_with_multiple_elements(self) -> None: """Verify single_or_default_async errors with multiple elements.""" source: Observable[int] = rx.of(1, 2, 3) - fluent_result: Observable[int] = source.single_or_default_async() - pipe_result: Observable[int] = source.pipe(ops.single_or_default_async()) + fluent_result: Observable[int] = source.single_or_default_async() # type: ignore[assignment] + pipe_result: Observable[int] = source.pipe(ops.single_or_default_async()) # type: ignore[assignment] fluent_errors: list[Exception] = [] pipe_errors: list[Exception] = [] diff --git a/tests/test_observable/test_flatmap_async.py b/tests/test_observable/test_flatmap_async.py index c012b7f11..0a6be7837 100644 --- a/tests/test_observable/test_flatmap_async.py +++ b/tests/test_observable/test_flatmap_async.py @@ -22,7 +22,7 @@ def on_next(i: int): nonlocal actual_next actual_next = i - def on_error(ex): + def on_error(ex: Exception) -> None: print("Error", ex) async def test_flat_map(): diff --git a/tests/test_observable/test_interval.py b/tests/test_observable/test_interval.py index fe589fa69..8c2d1ab35 100644 --- a/tests/test_observable/test_interval.py +++ b/tests/test_observable/test_interval.py @@ -17,7 +17,7 @@ class RxException(Exception): # Helper function for raising exceptions within lambdas -def _raise(ex): +def _raise(ex: Exception) -> None: raise RxException(ex) diff --git a/tests/test_observable/test_pluck.py b/tests/test_observable/test_pluck.py index a51ad8dde..784155651 100644 --- a/tests/test_observable/test_pluck.py +++ b/tests/test_observable/test_pluck.py @@ -44,7 +44,7 @@ def test_pluck_attr_completed(self): scheduler = TestScheduler() class DummyClass: - def __init__(self, prop): + def __init__(self, prop: int) -> None: self.prop = prop xs = scheduler.create_hot_observable( diff --git a/tests/test_observable/test_repeat.py b/tests/test_observable/test_repeat.py index 91f66b172..803244259 100644 --- a/tests/test_observable/test_repeat.py +++ b/tests/test_observable/test_repeat.py @@ -18,7 +18,7 @@ class RxException(Exception): # Helper function for raising exceptions within lambdas -def _raise(ex): +def _raise(ex: Exception) -> None: raise RxException(ex) diff --git a/tests/test_observable/test_sample.py b/tests/test_observable/test_sample.py index a9c905072..602e9ed7f 100644 --- a/tests/test_observable/test_sample.py +++ b/tests/test_observable/test_sample.py @@ -17,11 +17,6 @@ class RxException(Exception): pass -# Helper function for raising exceptions within lambdas -def _raise(ex): - raise RxException(ex) - - class TestSample(unittest.TestCase): def test_sample_regular(self): scheduler = TestScheduler() diff --git a/tests/test_observable/test_throttlefirst.py b/tests/test_observable/test_throttlefirst.py index 25f65d6ab..dd0635940 100644 --- a/tests/test_observable/test_throttlefirst.py +++ b/tests/test_observable/test_throttlefirst.py @@ -16,11 +16,6 @@ class RxException(Exception): pass -# Helper function for raising exceptions within lambdas -def _raise(ex): - raise RxException(ex) - - class TestThrottleFirst(unittest.TestCase): def test_throttle_first_completed(self): scheduler = TestScheduler() diff --git a/tests/test_observable/test_throw.py b/tests/test_observable/test_throw.py index ff9b21d0b..8b5815aea 100644 --- a/tests/test_observable/test_throw.py +++ b/tests/test_observable/test_throw.py @@ -17,7 +17,7 @@ class RxException(Exception): # Helper function for raising exceptions within lambdas -def _raise(ex): +def _raise(ex: Exception) -> None: raise RxException(ex) diff --git a/tests/test_observable/test_timer.py b/tests/test_observable/test_timer.py index dd1fbc045..8f4009fa4 100644 --- a/tests/test_observable/test_timer.py +++ b/tests/test_observable/test_timer.py @@ -18,7 +18,7 @@ class RxException(Exception): # Helper function for raising exceptions within lambdas -def _raise(ex): +def _raise(ex: Exception) -> None: raise RxException(ex) @@ -31,7 +31,7 @@ def create(): return reactivex.timer(duetime=date) results = scheduler.start(create) - assert results.messages == [on_next(250.0, 0), on_completed(250.0)] + assert results.messages == [on_next(250, 0), on_completed(250)] def test_oneshot_timer_date_passed(self): scheduler = TestScheduler() diff --git a/tests/test_observable/test_utility_fluent.py b/tests/test_observable/test_utility_fluent.py index a8063c21c..8e56b0a0d 100644 --- a/tests/test_observable/test_utility_fluent.py +++ b/tests/test_observable/test_utility_fluent.py @@ -6,8 +6,6 @@ from typing import Any -import pytest - import reactivex as rx from reactivex import Observable, operators as ops from reactivex.scheduler import TimeoutScheduler diff --git a/tests/test_observable/test_windowing_fluent.py b/tests/test_observable/test_windowing_fluent.py index 26b9e505e..fbfcefb42 100644 --- a/tests/test_observable/test_windowing_fluent.py +++ b/tests/test_observable/test_windowing_fluent.py @@ -36,7 +36,7 @@ def test_partition_odds(self) -> None: """Test partition odds stream.""" source: Observable[int] = rx.of(1, 2, 3, 4, 5, 6) - evens, odds = source.partition(lambda x: x % 2 == 0) + _, odds = source.partition(lambda x: x % 2 == 0) odds_values: list[int] = [] odds.subscribe(on_next=odds_values.append)