This repository was archived by the owner on Aug 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -7,21 +7,21 @@ def test_invalid_format():
77 with pytest .raises (ImportFromStringError ) as exc :
88 import_from_string ("example:" )
99 expected = 'Import string "example:" must be in format "<module>:<attribute>".'
10- assert expected in str ( exc )
10+ assert exc . match ( expected )
1111
1212
1313def test_invalid_module ():
1414 with pytest .raises (ImportFromStringError ) as exc :
1515 import_from_string ("module_does_not_exist:myattr" )
1616 expected = 'Could not import module "module_does_not_exist".'
17- assert expected in str ( exc )
17+ assert exc . match ( expected )
1818
1919
2020def test_invalid_attr ():
2121 with pytest .raises (ImportFromStringError ) as exc :
2222 import_from_string ("tempfile:attr_does_not_exist" )
2323 expected = 'Attribute "attr_does_not_exist" not found in module "tempfile".'
24- assert expected in str ( exc )
24+ assert exc . match ( expected )
2525
2626
2727def test_internal_import_error ():
You can’t perform that action at this time.
0 commit comments