Skip to content

Commit cec2a53

Browse files
authored
fix(tests.openadapt.privacy.providers): failing test_comprehend_scrub.py (#488)
* skip all the tests if ther is an issue wiht aws config files, either they are not htere or incorrect values are porided * format
1 parent 5fa12eb commit cec2a53

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

tests/openadapt/privacy/providers/test_comprehend_scrub.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
"""Module to test ComprehendScrubbingProvider."""
22

3+
from botocore.exceptions import NoRegionError
4+
import pytest
35

46
from openadapt.privacy.providers.aws_comprehend import ComprehendScrubbingProvider
57

68
scrub = ComprehendScrubbingProvider()
79

10+
try:
11+
scrub.scrub_text("hello Bob smith")
12+
except NoRegionError:
13+
msg = (
14+
"AWS Config Files not setup correctly. Please see "
15+
"https://boto3.amazonaws.com/v1/documentation/api/latest/guide/quickstart.html#configuration" # noqa: E501
16+
)
17+
pytestmark = pytest.mark.skip(reason=msg)
18+
819

920
def _hex_to_rgb(hex_color: int) -> tuple[int, int, int]:
1021
"""Convert a hex color (int) to RGB.

0 commit comments

Comments
 (0)