@@ -165,10 +165,9 @@ class TestResource(resources.Resource):
165
165
with self .assertRaises (TypeError ) as context :
166
166
TestResource ()
167
167
168
- self .assertEqual (
169
- "Can't instantiate abstract class TestResource with abstract methods init, shutdown" ,
170
- str (context .exception ),
171
- )
168
+ self .assertIn ("Can't instantiate abstract class TestResource" , str (context .exception ))
169
+ self .assertIn ("init, shutdown" , str (context .exception ))
170
+
172
171
173
172
def test_init_class_abc_shutdown_definition_is_required (self ):
174
173
class TestResource (resources .Resource ):
@@ -178,10 +177,8 @@ def init(self):
178
177
with self .assertRaises (TypeError ) as context :
179
178
TestResource ()
180
179
181
- self .assertEqual (
182
- "Can't instantiate abstract class TestResource with abstract method shutdown" ,
183
- str (context .exception ),
184
- )
180
+ self .assertIn ("Can't instantiate abstract class TestResource" , str (context .exception ))
181
+ self .assertIn ("shutdown" , str (context .exception ))
185
182
186
183
def test_init_not_callable (self ):
187
184
provider = providers .Resource (1 )
@@ -507,10 +504,8 @@ class TestAsyncResource(resources.AsyncResource):
507
504
with self .assertRaises (TypeError ) as context :
508
505
TestAsyncResource ()
509
506
510
- self .assertEqual (
511
- "Can't instantiate abstract class TestAsyncResource with abstract methods init, shutdown" ,
512
- str (context .exception ),
513
- )
507
+ self .assertIn ("Can't instantiate abstract class TestAsyncResource" , str (context .exception ))
508
+ self .assertIn ("init, shutdown" , str (context .exception ))
514
509
515
510
def test_init_async_class_abc_shutdown_definition_is_required (self ):
516
511
class TestAsyncResource (resources .AsyncResource ):
@@ -520,10 +515,8 @@ async def init(self):
520
515
with self .assertRaises (TypeError ) as context :
521
516
TestAsyncResource ()
522
517
523
- self .assertEqual (
524
- "Can't instantiate abstract class TestAsyncResource with abstract method shutdown" ,
525
- str (context .exception ),
526
- )
518
+ self .assertIn ("Can't instantiate abstract class TestAsyncResource" , str (context .exception ))
519
+ self .assertIn ("shutdown" , str (context .exception ))
527
520
528
521
def test_init_with_error (self ):
529
522
async def _init ():
0 commit comments