@@ -79,19 +79,19 @@ def setup_server(description=None, context=None, cmdline=None):
7979 # If you initialize a DataBlock to addresses of 0x00 to 0xFF, a request to
8080 # 0x100 will respond with an invalid address exception.
8181 # This is because many devices exhibit this kind of behavior (but not all)
82- if args .store == "sequential" :
82+ if args .store == "sequential" : # pragma: no cover
8383 # Continuing, use a sequential block without gaps.
8484 datablock = lambda : ModbusSequentialDataBlock (0x00 , [17 ] * 100 ) # pylint: disable=unnecessary-lambda-assignment
85- elif args .store == "sparse" :
85+ elif args .store == "sparse" : # pragma: no cover
8686 # Continuing, or use a sparse DataBlock which can have gaps
8787 datablock = lambda : ModbusSparseDataBlock ({0x00 : 0 , 0x05 : 1 }) # pylint: disable=unnecessary-lambda-assignment
88- elif args .store == "factory" :
88+ elif args .store == "factory" : # pragma: no cover
8989 # Alternately, use the factory methods to initialize the DataBlocks
9090 # or simply do not pass them to have them initialized to 0x00 on the
9191 # full address range::
9292 datablock = lambda : ModbusSequentialDataBlock .create () # pylint: disable=unnecessary-lambda-assignment,unnecessary-lambda
9393
94- if args .device_ids > 1 :
94+ if args .device_ids > 1 : # pragma: no cover
9595 # The server then makes use of a server context that allows the server
9696 # to respond with different device contexts for different device ids.
9797 # By default it will return the same context for every device id supplied
@@ -185,7 +185,7 @@ async def run_async_server(args) -> None:
185185 # ignore_missing_devices=True, # ignore request to a missing device
186186 # broadcast_enable=False, # treat device_id 0 as broadcast address,
187187 )
188- elif args .comm == "tls" :
188+ elif args .comm == "tls" : # pragma: no cover
189189 address = (args .host if args .host else "" , args .port if args .port else None )
190190 await StartAsyncTlsServer (
191191 context = args .context , # Data storage
@@ -208,7 +208,7 @@ async def run_async_server(args) -> None:
208208 )
209209
210210
211- async def async_helper () -> None :
211+ async def async_helper () -> None : # pragma: no cover
212212 """Combine setup and run."""
213213 _logger .info ("Starting..." )
214214 run_args = setup_server (description = "Run asynchronous server." )
0 commit comments