@@ -32,7 +32,7 @@ def needs_assert_rewrite(pytestconfig):
32
32
)
33
33
34
34
35
- class UnixFS ( object ) :
35
+ class UnixFS :
36
36
"""
37
37
Wrapper to os functions to simulate a Unix file system, used for testing
38
38
the mock fixture.
@@ -205,7 +205,7 @@ def test_repr_with_no_name(self, mocker):
205
205
def test_repr_with_name (self , mocker ):
206
206
test_name = "funny walk"
207
207
stub = mocker .stub (name = test_name )
208
- assert "name={0 !r}" .format (test_name ) in repr (stub )
208
+ assert "name={!r}" .format (test_name ) in repr (stub )
209
209
210
210
def __test_failure_message (self , mocker , ** kwargs ):
211
211
expected_name = kwargs .get ("name" ) or "mock"
@@ -228,7 +228,7 @@ def test_failure_message_with_name(self, mocker, name):
228
228
229
229
230
230
def test_instance_method_spy (mocker ):
231
- class Foo ( object ) :
231
+ class Foo :
232
232
def bar (self , arg ):
233
233
return arg * 2
234
234
@@ -246,7 +246,7 @@ def bar(self, arg):
246
246
def test_instance_method_spy_exception (mocker ):
247
247
excepted_message = "foo"
248
248
249
- class Foo ( object ) :
249
+ class Foo :
250
250
def bar (self , arg ):
251
251
raise Exception (excepted_message )
252
252
@@ -264,7 +264,7 @@ def bar(self, arg):
264
264
265
265
@skip_pypy
266
266
def test_instance_method_by_class_spy (mocker ):
267
- class Foo ( object ) :
267
+ class Foo :
268
268
def bar (self , arg ):
269
269
return arg * 2
270
270
@@ -279,7 +279,7 @@ def bar(self, arg):
279
279
280
280
@skip_pypy
281
281
def test_instance_method_by_subclass_spy (mocker ):
282
- class Base ( object ) :
282
+ class Base :
283
283
def bar (self , arg ):
284
284
return arg * 2
285
285
@@ -298,7 +298,7 @@ class Foo(Base):
298
298
299
299
@skip_pypy
300
300
def test_class_method_spy (mocker ):
301
- class Foo ( object ) :
301
+ class Foo :
302
302
@classmethod
303
303
def bar (cls , arg ):
304
304
return arg * 2
@@ -314,7 +314,7 @@ def bar(cls, arg):
314
314
@skip_pypy
315
315
@pytest .mark .xfail (sys .version_info [0 ] == 2 , reason = "does not work on Python 2" )
316
316
def test_class_method_subclass_spy (mocker ):
317
- class Base ( object ) :
317
+ class Base :
318
318
@classmethod
319
319
def bar (self , arg ):
320
320
return arg * 2
@@ -335,7 +335,7 @@ def test_class_method_with_metaclass_spy(mocker):
335
335
class MetaFoo (type ):
336
336
pass
337
337
338
- class Foo ( object ) :
338
+ class Foo :
339
339
340
340
__metaclass__ = MetaFoo
341
341
@@ -353,7 +353,7 @@ def bar(cls, arg):
353
353
354
354
@skip_pypy
355
355
def test_static_method_spy (mocker ):
356
- class Foo ( object ) :
356
+ class Foo :
357
357
@staticmethod
358
358
def bar (arg ):
359
359
return arg * 2
@@ -369,7 +369,7 @@ def bar(arg):
369
369
@skip_pypy
370
370
@pytest .mark .xfail (sys .version_info [0 ] == 2 , reason = "does not work on Python 2" )
371
371
def test_static_method_subclass_spy (mocker ):
372
- class Base ( object ) :
372
+ class Base :
373
373
@staticmethod
374
374
def bar (arg ):
375
375
return arg * 2
@@ -492,8 +492,8 @@ def test_assert_called_wrapper(mocker):
492
492
def test_assert_called_args_with_introspection (mocker ):
493
493
stub = mocker .stub ()
494
494
495
- complex_args = ("a" , 1 , set ([ "test" ]) )
496
- wrong_args = ("b" , 2 , set ([ "jest" ]) )
495
+ complex_args = ("a" , 1 , { "test" } )
496
+ wrong_args = ("b" , 2 , { "jest" } )
497
497
498
498
stub (* complex_args )
499
499
stub .assert_called_with (* complex_args )
@@ -714,7 +714,7 @@ def test_assert_called_with_unicode_arguments(mocker):
714
714
stub (b"l\xc3 \xb6 k" .decode ("UTF-8" ))
715
715
716
716
with pytest .raises (AssertionError ):
717
- stub .assert_called_with (u "lak" )
717
+ stub .assert_called_with ("lak" )
718
718
719
719
720
720
def test_plain_stopall (testdir ):
@@ -739,7 +739,7 @@ def test_get_random_number(mocker):
739
739
740
740
741
741
def test_abort_patch_object_context_manager (mocker ):
742
- class A ( object ) :
742
+ class A :
743
743
def doIt (self ):
744
744
return False
745
745
0 commit comments