pulumi/sdk/python/lib
Julien 43a9bd7fe6
Catch BaseException in automation API server (#17909)
Automation API is useful for writing tests for Pulumi programs, and a
user could write a test as follows:

```python
def program():
    with pytest.raises(ValueError):
        _a = 1 + 2  # No error here, pytest.raises should fail

stack = create_stack("mystack", program=program, project_name="proj")

with pytest.raises(InlineSourceRuntimeError):
    stack.preview()
```

If the block in `pytest.raises` does not raise the expected error or any
error, `pytest.raises` fails the test by raising an `OutcomeException`.
This exception class inherits from `BaseException`, not `Exception`, so
we would previously not catch this, and fail to report an error from the
automation API server's `Run` method, causing the call to
`stack.preview`
to hang indefinitely.

Fixes https://github.com/pulumi/pulumi/issues/17133
2024-12-03 15:47:58 +00:00
..
pulumi Catch BaseException in automation API server (#17909) 2024-12-03 15:47:58 +00:00
test Catch BaseException in automation API server (#17909) 2024-12-03 15:47:58 +00:00
test_types Fix Pyright type checking of "StackReference#outputs" (#16957) 2024-08-14 05:14:23 +00:00
test_with_mocks [sdk/{nodejs,python}] Fix errors when testing remote components with mocks (#8053) 2021-09-24 06:08:13 -07:00
setup.py Freeze v3.142.0 (#17873) 2024-11-26 15:46:25 +00:00