Skip to content

Commit

Permalink
Fix Pylint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
garlontas committed Jun 26, 2023
1 parent d7da24c commit 4d38008
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
2 changes: 1 addition & 1 deletion pystreamapi/_streams/__base_stream.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
from abc import abstractmethod
from builtins import reversed
from functools import cmp_to_key
from typing import Iterable, Callable, Any, TypeVar, Iterator, Union
from typing import Iterable, Callable, Any, TypeVar, Iterator

from pystreamapi._lazy.process import Process
from pystreamapi._lazy.queue import ProcessQueue
Expand Down
9 changes: 5 additions & 4 deletions tests/test_optional.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ def test_map(self):
self.assertFalse(mapped_optional.is_present())

def test_flat_map(self):
# Test that flat_map applies the mapper function to the Optional's value and returns the result
# Test that flat_map applies the mapper function to the
# Optional's value and returns the result
optional = Optional.of(5)
mapped_optional = optional.flat_map(lambda x: Optional.of(x * 2))
self.assertTrue(mapped_optional.is_present())
Expand Down Expand Up @@ -95,13 +96,13 @@ def test_if_present(self):
# Test that if_present calls the consumer function if the Optional is present
optional = Optional.of(5)
result = []
optional.if_present(lambda x: result.append(x))
optional.if_present(result.append)
self.assertEqual(result, [5])

# Test that if_present doesn't call the consumer function if the Optional is empty
optional = Optional.empty()
result = []
optional.if_present(lambda x: result.append(x))
optional.if_present(result.append)
self.assertEqual(result, [])

def test_str(self):
Expand Down Expand Up @@ -135,4 +136,4 @@ def test_eq(self):

# Test that eq returns False if the other object is not an Optional
optional = Optional.of(5)
self.assertNotEqual(optional, 5)
self.assertNotEqual(optional, 5)
2 changes: 1 addition & 1 deletion tests/test_stream_implementation.py
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import unittest

from pystreamapi.__optional import Optional
from parameterized import parameterized_class

from pystreamapi._streams.__base_stream import BaseStream
from pystreamapi._streams.__parallel_stream import ParallelStream
from pystreamapi._streams.__sequential_stream import SequentialStream
from pystreamapi._streams.numeric.__sequential_numeric_stream import SequentialNumericStream
from pystreamapi.__optional import Optional


@parameterized_class("stream", [
Expand Down

0 comments on commit 4d38008

Please sign in to comment.