Hi,

You can follow a similar pattern to this
https://github.com/apache/beam/blob/c6f8e0be1a51a32730754934c3f40eaae39d0f98/sdks/python/apache_beam/metrics/metric_test.py#L130
.

```
with self.assertRaises(ValueError):
     <your-code>

```

On Tue, Apr 4, 2023 at 7:24 PM Grace Young via dev <dev@beam.apache.org>
wrote:

> How can I confirm in a test that a ValueError is raised by certain cases?
>
> --
> [image: X] *Dr. Grace Young*
> Research Engineer | Tidal <https://x.company/projects/tidal/>
> gcyo...@google.com | x.company
>

Reply via email to