From af474a283f254d9c3456bb2e75cf71a4bda5411e Mon Sep 17 00:00:00 2001 From: Leon Hiemstra <hiemstra@astron.nl> Date: Wed, 12 Nov 2014 09:37:58 +0000 Subject: [PATCH] removed 'with' --- .../unb1_test/tb/python/tc_unb1_test.py | 48 ++++++++++--------- 1 file changed, 25 insertions(+), 23 deletions(-) diff --git a/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py b/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py index d73cc739a4..bba8c038f8 100644 --- a/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py +++ b/boards/uniboard1/designs/unb1_test/tb/python/tc_unb1_test.py @@ -174,24 +174,25 @@ def test_info(tc,io,cmd): tc.append_log(1, '>>> %s' % help_text(tc,io,cmd)) tc.append_log(3, '>>>') - with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io: - info = pi_system_info.PiSystemInfo(tc, temp_io) - tc.append_log(1, '>>> reading REGMAPs') - info.make_register_info() - tc.append_log(3, '') - info.read_system_info() - tc.append_log(3, '') - info.read_use_phy() - tc.append_log(3, '') - design_name = info.read_design_name() - tc.append_log(1, '>>> design_name=%s' % design_name) - tc.append_log(3, '') - info.read_stamps() - tc.append_log(3, '') - info.read_design_note() + #with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io: + temp_io = node_io.NodeIO(tc.nodeImages, tc.base_ip) + info = pi_system_info.PiSystemInfo(tc, temp_io) + tc.append_log(1, '>>> reading REGMAPs') + info.make_register_info() + tc.append_log(3, '') + info.read_system_info() + tc.append_log(3, '') + info.read_use_phy() + tc.append_log(3, '') + design_name = info.read_design_name() + tc.append_log(1, '>>> design_name=%s' % design_name) + tc.append_log(3, '') + info.read_stamps() + tc.append_log(3, '') + info.read_design_note() - expected_design_name = tc.gpString - if cmd==3 and expected_design_name != '': + expected_design_name = tc.gpString + if cmd==3 and expected_design_name != '': tc.set_section_id('Verify System Info - ') tc.append_log(1, '>>> Verifying design_name == %s' % expected_design_name) for name in design_name: @@ -252,16 +253,17 @@ def test_remu(tc,io,cmd): tc.append_log(3, '>>>') dummy_tc = test_case.Testcase('Dummy TB - ', '') - with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io: - dummy_tc.set_result('PASSED') + #with node_io.NodeIO(tc.nodeImages, tc.base_ip) as temp_io: + temp_io = node_io.NodeIO(tc.nodeImages, tc.base_ip) + dummy_tc.set_result('PASSED') - Remu = pi_remu.PiRemu(dummy_tc, temp_io) - try: + Remu = pi_remu.PiRemu(dummy_tc, temp_io) + try: Remu.write_user_reconfigure() - except: + except: pass # ignoring FAILED - if dummy_tc.get_result() == 'FAILED': + if dummy_tc.get_result() == 'FAILED': tc.append_log(1, 'Result=%s but ignoring this' % dummy_tc.get_result()) del dummy_tc -- GitLab