Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
def test_invalid_parse_in_strict_mode(pattern, path):
'''Fail to extract data in strict mode when invalid duplicates detected.'''
template = Template(
'test', pattern, duplicate_placeholder_mode=Template.STRICT
)
with pytest.raises(ParseError) as exception:
template.parse(path)
assert 'Different extracted values' in str(exception.value)