You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@beam.apache.org by Grace Young via dev <de...@beam.apache.org> on 2023/04/04 23:21:23 UTC
Beam Website Feedback
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/>
gcyoung@google.com | x.company
Re: Beam Website Feedback
Posted by Anand Inguva via dev <de...@beam.apache.org>.
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 <de...@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/>
> gcyoung@google.com | x.company
>