File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -7,21 +7,21 @@ def test_invalid_format():
7
7
with pytest .raises (ImportFromStringError ) as exc :
8
8
import_from_string ("example:" )
9
9
expected = 'Import string "example:" must be in format "<module>:<attribute>".'
10
- assert expected in str ( exc )
10
+ assert exc . match ( expected )
11
11
12
12
13
13
def test_invalid_module ():
14
14
with pytest .raises (ImportFromStringError ) as exc :
15
15
import_from_string ("module_does_not_exist:myattr" )
16
16
expected = 'Could not import module "module_does_not_exist".'
17
- assert expected in str ( exc )
17
+ assert exc . match ( expected )
18
18
19
19
20
20
def test_invalid_attr ():
21
21
with pytest .raises (ImportFromStringError ) as exc :
22
22
import_from_string ("tempfile:attr_does_not_exist" )
23
23
expected = 'Attribute "attr_does_not_exist" not found in module "tempfile".'
24
- assert expected in str ( exc )
24
+ assert exc . match ( expected )
25
25
26
26
27
27
def test_internal_import_error ():
You can’t perform that action at this time.
0 commit comments