File tree Expand file tree Collapse file tree 6 files changed +15
-8
lines changed
legacy/mbed-greentea/test Expand file tree Collapse file tree 6 files changed +15
-8
lines changed Original file line number Diff line number Diff line change @@ -112,4 +112,4 @@ jobs:
112
112
architecture : x64
113
113
-
114
114
script : ' python setup.py sdist'
115
- displayName : ' Build sdist'
115
+ displayName : ' Build sdist'
Original file line number Diff line number Diff line change @@ -74,9 +74,10 @@ def test_get_greentea_version(self):
74
74
def test_print_version (self ):
75
75
version = mbed_greentea_cli .get_greentea_version ()
76
76
77
+ old_stdout = sys .stdout
77
78
sys .stdout = stdout_capture = six .StringIO ()
78
79
mbed_greentea_cli .print_version ()
79
- sys .stdout = sys . __stdout__
80
+ sys .stdout = old_stdout
80
81
81
82
printed_version = stdout_capture .getvalue ().splitlines ()[0 ]
82
83
self .assertEqual (printed_version , version )
Original file line number Diff line number Diff line change @@ -100,9 +100,10 @@ def test_list_binaries_for_targets(self):
100
100
full_path = os .path .join (root_path , "resources" )
101
101
102
102
def run_and_capture (path , verbose = False ):
103
+ old_stdout = sys .stdout
103
104
sys .stdout = stdout_capture = six .StringIO ()
104
105
cmake_handlers .list_binaries_for_targets (build_dir = path , verbose_footer = verbose )
105
- sys .stdout = sys . __stdout__
106
+ sys .stdout = old_stdout
106
107
107
108
return stdout_capture .getvalue ()
108
109
@@ -128,9 +129,10 @@ def test_list_binaries_for_builds(self):
128
129
129
130
for verbose in [True , False ]:
130
131
# Capture logging output
132
+ old_stdout = sys .stdout
131
133
sys .stdout = stdout_capture = six .StringIO ()
132
134
cmake_handlers .list_binaries_for_builds (spec , verbose_footer = verbose )
133
- sys .stdout = sys . __stdout__
135
+ sys .stdout = old_stdout
134
136
135
137
output = stdout_capture .getvalue ()
136
138
self .assertTrue ("available tests for build 'K64F-ARM'" in output )
Original file line number Diff line number Diff line change @@ -105,9 +105,10 @@ def test_export_to_file(self):
105
105
payload = "PAYLOAD"
106
106
filepath = "."
107
107
108
+ old_stdout = sys .stdout
108
109
sys .stdout = stdout_capture = six .StringIO ()
109
110
result = mbed_report_api .export_to_file (filepath , payload )
110
- sys .stdout = sys . __stdout__
111
+ sys .stdout = old_stdout
111
112
112
113
command_output = stdout_capture .getvalue ().splitlines ()[0 ]
113
114
self .assertIn ("file failed:" , command_output )
Original file line number Diff line number Diff line change @@ -98,9 +98,10 @@ def test_list_binaries_for_targets(self):
98
98
full_path = os .path .join (root_path , "resources" )
99
99
100
100
def run_and_capture (path , verbose = False ):
101
+ old_stdout = sys .stdout
101
102
sys .stdout = stdout_capture = six .StringIO ()
102
103
cmake_handlers .list_binaries_for_targets (build_dir = path , verbose_footer = verbose )
103
- sys .stdout = sys . __stdout__
104
+ sys .stdout = old_stdout
104
105
105
106
return stdout_capture .getvalue ()
106
107
@@ -126,9 +127,10 @@ def test_list_binaries_for_builds(self):
126
127
127
128
for verbose in [True , False ]:
128
129
# Capture logging output
130
+ old_stdout = sys .stdout
129
131
sys .stdout = stdout_capture = six .StringIO ()
130
132
cmake_handlers .list_binaries_for_builds (spec , verbose_footer = verbose )
131
- sys .stdout = sys . __stdout__
133
+ sys .stdout = old_stdout
132
134
133
135
output = stdout_capture .getvalue ()
134
136
self .assertTrue ("available tests for build 'K64F-ARM'" in output )
Original file line number Diff line number Diff line change @@ -106,9 +106,10 @@ def test_export_to_file(self):
106
106
payload = "PAYLOAD"
107
107
filepath = "."
108
108
109
+ old_stdout = sys .stdout
109
110
sys .stdout = stdout_capture = six .StringIO ()
110
111
result = mbed_report_api .export_to_file (filepath , payload )
111
- sys .stdout = sys . __stdout__
112
+ sys .stdout = old_stdout
112
113
113
114
command_output = stdout_capture .getvalue ().splitlines ()[0 ]
114
115
self .assertIn ("file failed:" , command_output )
You can’t perform that action at this time.
0 commit comments