Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 0 additions & 5 deletions tests/test_observable/test_blocking/test_blocking.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_combinelatest.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_contains.py
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_count.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_empty.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
12 changes: 6 additions & 6 deletions tests/test_observable/test_filtering_fluent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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] = []
Expand Down Expand Up @@ -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] = []
Expand All @@ -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] = []
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_flatmap_async.py
Original file line number Diff line number Diff line change
Expand Up @@ -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():
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_interval.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_pluck.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_repeat.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
5 changes: 0 additions & 5 deletions tests/test_observable/test_sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
5 changes: 0 additions & 5 deletions tests/test_observable/test_throttlefirst.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_throw.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand Down
4 changes: 2 additions & 2 deletions tests/test_observable/test_timer.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)


Expand All @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions tests/test_observable/test_utility_fluent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion tests/test_observable/test_windowing_fluent.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down