File tree Expand file tree Collapse file tree 12 files changed +46
-27
lines changed Expand file tree Collapse file tree 12 files changed +46
-27
lines changed Original file line number Diff line number Diff line change 22
22
import sys
23
23
import random
24
24
import optparse
25
- import imp
25
+ import importlib
26
26
import io
27
27
from time import time
28
28
try :
@@ -187,7 +187,7 @@ def main():
187
187
188
188
# Show --fm option only if "fm_agent" module installed
189
189
try :
190
- imp . find_module ('fm_agent' )
190
+ importlib . util . find_spec ('fm_agent' )
191
191
except ImportError :
192
192
fm_help = optparse .SUPPRESS_HELP
193
193
else :
Original file line number Diff line number Diff line change 1
- mbed-os-tools >= 0.0.9
2
- mbed-host-tests >= 1.5.0 ,< 2
1
+ mbed-os-tools >= 0.0.9 ; python_version < = '3.7'
2
+ mbed-os-tools ; python_version > '3.7'
3
+ mbed-host-tests >= 1.5.0 ,< 2 ; python_version < = '3.7'
4
+ mbed-host-tests ; python_version > '3.7'
Original file line number Diff line number Diff line change 1
- mock>=2
1
+ mock>=2; python_version <= '3.7'
2
+ mock; python_version > '3.7'
2
3
coverage
3
4
coveralls
Original file line number Diff line number Diff line change 1
- mbed-os-tools >= 0.0.9
1
+ mbed-os-tools >= 0.0.9 ; python_version < = '3.7'
2
+ mbed-os-tools ; python_version > '3.7'
Original file line number Diff line number Diff line change @@ -80,7 +80,7 @@ def setUp(self):
80
80
def test_constructor (self ):
81
81
self .importer .assert_called_once_with ("RemoteModuleMock" )
82
82
83
- self .remote .client .get_resources .called_once ()
83
+ self .remote .client .get_resources .assert_called_once ()
84
84
self .assertEqual (self .remote .remote_module , RemoteModuleMock )
85
85
self .assertIsInstance (self .remote .client , RemoteModuleMock )
86
86
self .assertIsInstance (self .remote .selected_resource , RemoteResourceMock )
@@ -93,10 +93,10 @@ def test_constructor(self):
93
93
'tags' : {"a" : True , "b" : True }})
94
94
95
95
# flash is called
96
- self .remote .selected_resource .open_connection .called_once_with ("test.bin" )
96
+ # self.remote.selected_resource.open_connection.called_once_with("test.bin")
97
97
98
98
# open_connection is called
99
- self .remote .selected_resource .open_connection .called_once ()
99
+ self .remote .selected_resource .open_connection .assert_called_once ()
100
100
connect = self .remote .selected_resource .open_connection .call_args [1 ]
101
101
self .assertEqual (connect ["parameters" ].baudrate , 9600 )
102
102
Original file line number Diff line number Diff line change 1
- mock>=2
1
+ mock>=2; python_version <= '3.7'
2
+ mock; python_version > '3.7'
2
3
coverage
3
4
coveralls
Original file line number Diff line number Diff line change 1
1
PrettyTable <= 1.0.1 ; python_version < '3.6'
2
- prettytable >= 2.0 ,< 3.0 ; python_version >= '3.6'
3
- mbed-os-tools >= 0.0.9
2
+ prettytable >= 2.0 ,< 3.0 ; python_version == '3.7'
3
+ prettytable ; python_version > '3.7'
4
+ mbed-os-tools >= 0.0.9 ; python_version < = '3.7'
5
+ mbed-os-tools ; python_version > '3.7'
Original file line number Diff line number Diff line change 1
- mock>=2
2
- pytest>=3
1
+ mock>=2; python_version <= '3.7'
2
+ mock; python_version > '3.7'
3
+ pytest>=3; python_version <= '3.7'
4
+ pytest; python_version > '3.7'
3
5
coverage
4
6
coveralls
Original file line number Diff line number Diff line change @@ -5,7 +5,7 @@ requests; python_version > '3.7'
5
5
intelhex >= 2.0 ,< 3.0 ; python_version < = '3.7'
6
6
intelhex ; python_version > '3.7'
7
7
future
8
- PrettyTable <= 1.0.1 ; python_version < '3.6'
8
+ PrettyTable <= 1.0.1 ; python_version < = '3.6'
9
9
prettytable >= 2.0 ,< 3.0 ; python_version == '3.7'
10
10
prettytable ; python_version > '3.7'
11
11
fasteners
@@ -19,5 +19,9 @@ six; python_version > '3.7'
19
19
colorama >= 0.3 ,< 0.5 ; python_version < = '3.7'
20
20
colorama ; python_version > '3.7'
21
21
# When using beautiful soup, the XML parser needs to be installed independently. It is only needed on macOs though.
22
- beautifulsoup4
22
+ beautifulsoup4 < 4.13.0 ; python_version < = '3.6' #__future__ added
23
+ beautifulsoup4 ; python_version >= '3.7'
24
+ soupsieve < 2.4 ; python_version < = '3.7' #__future__ added
25
+ soupsieve ; python_version > '3.7'
23
26
lxml ; sys_platform == 'darwin'
27
+ setuptools ; python_version >= '3.12'
Original file line number Diff line number Diff line change 22
22
23
23
"""
24
24
25
- import imp
25
+ import importlib
26
26
import sys
27
27
from optparse import OptionParser
28
28
from optparse import SUPPRESS_HELP
@@ -245,7 +245,7 @@ def init_host_test_cli_params():
245
245
246
246
# Show --fm option only if "fm_agent" module installed
247
247
try :
248
- imp . find_module ("fm_agent" )
248
+ importlib . util . find_spec ("fm_agent" )
249
249
except ImportError :
250
250
fm_help = SUPPRESS_HELP
251
251
else :
Original file line number Diff line number Diff line change @@ -78,7 +78,7 @@ def setUp(self):
78
78
def test_constructor (self ):
79
79
self .importer .assert_called_once_with ("RemoteModuleMock" )
80
80
81
- self .remote .client .get_resources .called_once ()
81
+ self .remote .client .get_resources .assert_called_once ()
82
82
self .assertEqual (self .remote .remote_module , RemoteModuleMock )
83
83
self .assertIsInstance (self .remote .client , RemoteModuleMock )
84
84
self .assertIsInstance (self .remote .selected_resource , RemoteResourceMock )
@@ -91,10 +91,10 @@ def test_constructor(self):
91
91
'tags' : {"a" : True , "b" : True }})
92
92
93
93
# flash is called
94
- self .remote .selected_resource .open_connection .called_once_with ("test.bin" )
94
+ ## self.remote.selected_resource.open_connection.called_once_with("test.bin")
95
95
96
96
# open_connection is called
97
- self .remote .selected_resource .open_connection .called_once ()
97
+ self .remote .selected_resource .open_connection .assert_called_once ()
98
98
connect = self .remote .selected_resource .open_connection .call_args [1 ]
99
99
self .assertEqual (connect ["parameters" ].baudrate , 9600 )
100
100
Original file line number Diff line number Diff line change 1
- coverage>=4,<5
2
- coveralls>=1,<2
3
- mock>=2,<4
4
- pytest>=3,<5
5
- wheel>=0.34
6
- setuptools-scm>=4.1
1
+ coverage>=4,<5; python_version <= '3.7'
2
+ coverage; python_version > '3.7'
3
+ coveralls>=1,<2; python_version <= '3.7'
4
+ coveralls; python_version > '3.7'
5
+ mock>=2,<4; python_version <= '3.7'
6
+ mock; python_version > '3.7'
7
+ pytest>=3,<5; python_version <= '3.7'
8
+ pytest; python_version > '3.7'
9
+ wheel>=0.34; python_version <= '3.7'
10
+ wheel; python_version > '3.7'
11
+ setuptools-scm>=4.1; python_version <= '3.7'
12
+ setuptools-scm; python_version > '3.7'
You can’t perform that action at this time.
0 commit comments