========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= test session starts ==========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
platform linux -- Python 3.10.12, pytest-9.0.3, pluggy-1.6.0
rootdir: /workspace/simpy
configfile: pyproject.toml
plugins: metadata-3.1.1, anyio-4.13.0, cov-7.1.0, json-report-1.5.0
collected 150 items / 10 deselected / 140 selected

tests/test_condition.py ....F.............F..                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [ 15%]
tests/test_environment.py ......                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 [ 19%]
tests/test_event.py .........                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                    [ 25%]
tests/test_exceptions.py ...F......                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [ 32%]
tests/test_interrupts.py ..........                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                              [ 40%]
tests/test_process.py .........                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                  [ 46%]
tests/test_resources.py ........................................                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 [ 75%]
tests/test_rt.py .........                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       [ 81%]
tests/test_timeout.py .....                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                      [ 85%]
tests/test_util.py ....................                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [ 99%]
tests/test_version.py .                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                          [100%]

=============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== FAILURES ===============================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
_______________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_operator_nested_or ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

env = <simpy.core.Environment object at 0x72cd31c996f0>

    def process(env):
        timeout = [env.timeout(delay, value=delay) for delay in range(3)]
        results = yield (timeout[0] | timeout[1]) & timeout[2]

>       assert results == {
            timeout[0]: 0,
            timeout[1]: 1,
            timeout[2]: 2,
        }
E       assert <ConditionVal...31c9a0b0>: 2}> == {<Timeout(0, ...d31c9a0b0>: 2}
E
E         Use -v to get more diff

tests/test_condition.py:65: AssertionError

The above exception was the direct cause of the following exception:

env = <simpy.core.Environment object at 0x72cd31c996f0>

    def test_operator_nested_or(env):
        def process(env):
            timeo<response clipped><NOTE>Due to the max output limit, only part of the full response has been shown to you.</NOTE>__________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________ test_exception_chaining ________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________________

env = <simpy.core.Environment object at 0x72cd31f12680>

    def child(env):
        yield env.timeout(1)
>       raise RuntimeError('foo')
E       RuntimeError: foo

tests/test_exceptions.py:80: RuntimeError

The above exception was the direct cause of the following exception:

env = <simpy.core.Environment object at 0x72cd31f12680>

    def parent(env):
        child_proc = env.process(child(env))
>       yield child_proc
E       RuntimeError: foo

tests/test_exceptions.py:84: RuntimeError

The above exception was the direct cause of the following exception:

env = <simpy.core.Environment object at 0x72cd31f12680>

    def grandparent(env):
        parent_proc = env.process(parent(env))
>       yield parent_proc
E       RuntimeError: foo

tests/test_exceptions.py:88: RuntimeError

The above exception was the direct cause of the following exception:

env = <simpy.core.Environment object at 0x72cd31f12680>

    def test_exception_chaining(env):
        """Unhandled exceptions pass through the entire event stack. This must be
        visible in the stacktrace of the exception.

        """

        def child(env):
            yield env.timeout(1)
            raise RuntimeError('foo')

        def parent(env):
            child_proc = env.process(child(env))
            yield child_proc

        def grandparent(env):
            parent_proc = env.process(parent(env))
            yield parent_proc

        env.process(grandparent(env))
        try:
>           env.run()

tests/test_exceptions.py:92:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _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_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <simpy.core.Environment object at 0x72cd31f12680>

    def step(self) -> None:
        """Process the next event.

        Raise an :exc:`EmptySchedule` if no further events are available.

        """
        try:
            self._now, _, _, event = heappop(self._queue)
        except IndexError:
            raise EmptySchedule from None

        callbacks, event.callbacks = event.callbacks, None
        for callback in callbacks:
            callback(event)

        if not event._ok and not event.defused:
            import copy

            exc = copy.copy(event._value)
            exc.__cause__ = event._value
>           raise exc
E           RuntimeError: foo

src/simpy/core.py:145: RuntimeError

During handling of the above exception, another exception occurred:

env = <simpy.core.Environment object at 0x72cd31f12680>

    def test_exception_chaining(env):
        """Unhandled exceptions pass through the entire event stack. This must be
        visible in the stacktrace of the exception.

        """

        def child(env):
            yield env.timeout(1)
            raise RuntimeError('foo')

        def parent(env):
            child_proc = env.process(child(env))
            yield child_proc

        def grandparent(env):
            parent_proc = env.process(parent(env))
            yield parent_proc

        env.process(grandparent(env))
        try:
            env.run()
            pytest.fail('There should have been an exception')
        except RuntimeError:
            trace = traceback.format_exc()

            expected = (
                re.escape(
                    textwrap.dedent(
                        """\
            Traceback (most recent call last):
              File "{path}tests/test_exceptions.py", line {line}, in child
                raise RuntimeError('foo')
            RuntimeError: foo

            The above exception was the direct cause of the following exception:

            Traceback (most recent call last):
              File "{path}tests/test_exceptions.py", line {line}, in parent
                yield child_proc
            RuntimeError: foo

            The above exception was the direct cause of the following exception:

            Traceback (most recent call last):
              File "{path}tests/test_exceptions.py", line {line}, in grandparent
                yield parent_proc
            RuntimeError: foo

            The above exception was the direct cause of the following exception:

            Traceback (most recent call last):
              File "{path}tests/test_exceptions.py", line {line}, in test_exception_chaining
                env.run()
              File "{path}simpy/core.py", line {line}, in run
                self.step()
              File "{path}simpy/core.py", line {line}, in step
                raise exc
            RuntimeError: foo
            """
                    )
                )
                .replace(r'\{line\}', r'\d+')
                .replace(r'\{path\}', r'.*')
            )

            if platform.system() == 'Windows':
                expected = expected.replace(r'\/', r'\\')

>           assert re.match(expected, trace), 'Traceback mismatch'
E           AssertionError: Traceback mismatch
E           assert None
E            +  where None = <function match at 0x72cd333e60e0>('Traceback\\ \\(most\\ recent\\ call\\ last\\):\\\n\\ \\ File\\ ".*tests/test_exceptions\\.py",\\ line\\ \\d+,\\ in\\ ...\\\n\\ \\ File\\ ".*simpy/core\\.py",\\ line\\ \\d+,\\ in\\ step\\\n\\ \\ \\ \\ raise\\ exc\\\nRuntimeError:\\ foo\\\n', 'Traceback (most recent call last):\n  File "/workspace/simpy/src/simpy/events.py", line 342, in _resume\n    event = ...n\n    self.step()\n  File "/workspace/simpy/src/simpy/core.py", line 145, in step\n    raise exc\nRuntimeError: foo\n')
E            +    where <function match at 0x72cd333e60e0> = re.match

tests/test_exceptions.py:140: AssertionError
=========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== warnings summary ===========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
tests/test_benchmark.py:18
  /workspace/simpy/tests/test_benchmark.py:18: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='frequent')

tests/test_benchmark.py:23
  /workspace/simpy/tests/test_benchmark.py:23: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='frequent')

tests/test_benchmark.py:28
  /workspace/simpy/tests/test_benchmark.py:28: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='frequent')

tests/test_benchmark.py:36
  /workspace/simpy/tests/test_benchmark.py:36: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='frequent')

tests/test_benchmark.py:46
  /workspace/simpy/tests/test_benchmark.py:46: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='targeted')

tests/test_benchmark.py:59
  /workspace/simpy/tests/test_benchmark.py:59: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='targeted')

tests/test_benchmark.py:72
  /workspace/simpy/tests/test_benchmark.py:72: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='targeted')

tests/test_benchmark.py:93
  /workspace/simpy/tests/test_benchmark.py:93: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='simulation')

tests/test_benchmark.py:119
  /workspace/simpy/tests/test_benchmark.py:119: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='simulation')

tests/test_benchmark.py:139
  /workspace/simpy/tests/test_benchmark.py:139: PytestUnknownMarkWarning: Unknown pytest.mark.benchmark - is this a typo?  You can register custom marks to avoid this warning - for details, see https://docs.pytest.org/en/stable/how-to/mark.html
    @pytest.mark.benchmark(group='simulation')

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================= short test summary info ========================================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
FAILED tests/test_condition.py::test_operator_nested_or - assert <ConditionVal...31c9a0b0>: 2}> == {<Timeout(0, ...d31c9a0b0>: 2}
FAILED tests/test_condition.py::test_nested_result_order - assert [<Timeout(0) ...72cd31c61420>] == [<Timeout(0) ...72cd31c61420>]
FAILED tests/test_exceptions.py::test_exception_chaining - AssertionError: Traceback mismatch
====================================================================================================================================================================================================================================================================================================================================================================================================================================================================================== 3 failed, 137 passed, 10 deselected, 10 warnings in 2.00s =======================================================================================================================================================================================================================================================================================================================================================================================================================================================================================
[The command completed with exit code 1.]
[Current working directory: /workspace/simpy]
[Python interpreter: /usr/bin/python]
[Command finished with exit code 1]