feat: add Reader monad #171
GitHub Actions / Test Results
failed
Jan 9, 2025 in 0s
1 fail, 35 pass in 0s
Annotations
Check warning on line 0 in src.tests.test_reader.TestReader
github-actions / Test Results
test_reader_reads_and_applies_environment_data_correctly (src.tests.test_reader.TestReader) failed
src/reports/junit-test-results.xml [took 0s]
Raw output
TypeError: 'type' object is not subscriptable
self = <tests.test_reader.TestReader testMethod=test_reader_reads_and_applies_environment_data_correctly>
def test_reader_reads_and_applies_environment_data_correctly(self):
# arrange
random_value = randint(0, 100) # nosec # B311 random in test is safe
environment = Environment(random_value)
def times2(env: Environment) -> int:
return env.some_value * 2
def multiply_env_by_2() -> Reader[Environment, int]:
return bind(ask(), lambda env: pure(_const(times2(env))))
> def env_multiplication_as_tuple() -> Reader[Environment, tuple[str, int]]:
E TypeError: 'type' object is not subscriptable
tests/test_reader.py:64: TypeError
Loading