Skip to content

feat: add Reader monad #171

feat: add Reader monad

feat: add Reader monad #171

GitHub Actions / Test Results failed Jan 9, 2025 in 0s

1 fail, 35 pass in 0s

36 tests  +4   35 ✅ +4   0s ⏱️ ±0s
 1 suites ±0    0 💤 ±0 
 1 files   ±0    1 ❌ ±0 

Results for commit 67bee51. ± Comparison against earlier commit 8712c53.

Annotations

Check warning on line 0 in src.tests.test_reader.TestReader

See this annotation in the file changed.

@github-actions 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