@@ -402,7 +402,7 @@ def mock_run_command_side_effect_disabled_timer(*args, **kwargs):
402402sonic_cfggen = load_module_from_source ('sonic_cfggen' , '/usr/local/bin/sonic-cfggen' )
403403
404404class TestHelper (object ):
405- def setup (self ):
405+ def setup_method (self ):
406406 print ("SETUP" )
407407
408408 @patch ('config.main.subprocess.Popen' )
@@ -417,11 +417,11 @@ def test_get_device_type(self, mock_subprocess):
417417 mock_subprocess .assert_called_with (['/usr/local/bin/sonic-cfggen' , '-m' , '-v' , 'DEVICE_METADATA.localhost.type' ], text = True , stdout = - 1 )
418418 assert device_type == "Unknown"
419419
420- def teardown (self ):
420+ def teardown_method (self ):
421421 print ("TEARDOWN" )
422422
423423class TestConfig (object ):
424- def setup (self ):
424+ def setup_method (self ):
425425 print ("SETUP" )
426426
427427 @patch ('config.main.subprocess.check_call' )
@@ -3463,7 +3463,7 @@ def teardown_class(cls):
34633463
34643464
34653465class TestConfigPfcwd (object ):
3466- def setup (self ):
3466+ def setup_method (self ):
34673467 print ("SETUP" )
34683468
34693469 @patch ('utilities_common.cli.run_command' )
@@ -3520,12 +3520,12 @@ def test_start_default(self, mock_run_command):
35203520 assert result .exit_code == 0
35213521 mock_run_command .assert_called_once_with (['pfcwd' , 'start_default' ], display_cmd = True )
35223522
3523- def teardown (self ):
3523+ def teardown_method (self ):
35243524 print ("TEARDOWN" )
35253525
35263526
35273527class TestConfigAclUpdate (object ):
3528- def setup (self ):
3528+ def setup_method (self ):
35293529 print ("SETUP" )
35303530
35313531 @patch ('utilities_common.cli.run_command' )
@@ -3548,12 +3548,12 @@ def test_incremental(self, mock_run_command):
35483548 assert result .exit_code == 0
35493549 mock_run_command .assert_called_once_with (['acl-loader' , 'update' , 'incremental' , file_name ])
35503550
3551- def teardown (self ):
3551+ def teardown_method (self ):
35523552 print ("TEARDOWN" )
35533553
35543554
35553555class TestConfigDropcounters (object ):
3556- def setup (self ):
3556+ def setup_method (self ):
35573557 print ("SETUP" )
35583558
35593559 @patch ('utilities_common.cli.run_command' )
@@ -3620,12 +3620,12 @@ def test_remove_reasons(self, mock_run_command):
36203620 assert result .exit_code == 0
36213621 mock_run_command .assert_called_once_with (['dropconfig' , '-c' , 'remove' , '-n' , str (counter_name ), '-r' , str (reasons )], display_cmd = True )
36223622
3623- def teardown (self ):
3623+ def teardown_method (self ):
36243624 print ("TEARDOWN" )
36253625
36263626
36273627class TestConfigDropcountersMasic (object ):
3628- def setup (self ):
3628+ def setup_method (self ):
36293629 print ("SETUP" )
36303630 os .environ ['UTILITIES_UNIT_TESTING' ] = "1"
36313631 os .environ ["UTILITIES_UNIT_TESTING_TOPOLOGY" ] = "multi_asic"
@@ -3746,7 +3746,7 @@ def teardown_class(cls):
37463746 dbconnector .load_namespace_config ()
37473747
37483748class TestConfigWatermarkTelemetry (object ):
3749- def setup (self ):
3749+ def setup_method (self ):
37503750 print ("SETUP" )
37513751
37523752 @patch ('utilities_common.cli.run_command' )
@@ -3759,12 +3759,12 @@ def test_interval(self, mock_run_command):
37593759 assert result .exit_code == 0
37603760 mock_run_command .assert_called_once_with (['watermarkcfg' , '--config-interval' , str (interval )])
37613761
3762- def teardown (self ):
3762+ def teardown_method (self ):
37633763 print ("TEARDOWN" )
37643764
37653765
37663766class TestConfigZtp (object ):
3767- def setup (self ):
3767+ def setup_method (self ):
37683768 print ("SETUP" )
37693769
37703770 @patch ('utilities_common.cli.run_command' )
@@ -3794,7 +3794,7 @@ def test_enable(self, mock_run_command):
37943794 assert result .exit_code == 0
37953795 mock_run_command .assert_called_once_with (['ztp' , 'enable' ], display_cmd = True )
37963796
3797- def teardown (self ):
3797+ def teardown_method (self ):
37983798 print ("TEARDOWN" )
37993799
38003800
@@ -3820,7 +3820,7 @@ def test_change_hostname(mock_run_command):
38203820
38213821
38223822class TestConfigInterface (object ):
3823- def setup (self ):
3823+ def setup_method (self ):
38243824 print ("SETUP" )
38253825
38263826 @patch ('utilities_common.cli.run_command' )
@@ -3960,7 +3960,7 @@ def test_startup_shutdown_loopback(self):
39603960 assert result .exit_code == 0
39613961 assert db .cfgdb .get_table ('LOOPBACK_INTERFACE' )['Loopback0' ]['admin_status' ] == 'up'
39623962
3963- def teardown (self ):
3963+ def teardown_method (self ):
39643964 print ("TEARDOWN" )
39653965
39663966
0 commit comments