@@ -61,7 +61,7 @@ def test_create_clone(self, os_ops: OsOperations):
6161 clone = os_ops .create_clone ()
6262 assert clone is not None
6363 assert clone is not os_ops
64- assert type (clone ) == type (os_ops ) # noqa: E721
64+ assert type (clone ) is type (os_ops )
6565
6666 def test_exec_command_success (self , os_ops : OsOperations ):
6767 """
@@ -759,11 +759,11 @@ def __init__(self, sign, source, cp_rw, cp_truncate, cp_binary, cp_data, result)
759759 )
760760 def write_data001 (self , request ):
761761 assert isinstance (request , pytest .FixtureRequest )
762- assert type (request .param ) == __class__ .tagWriteData001 # noqa: E721
762+ assert type (request .param ) is __class__ .tagWriteData001
763763 return request .param
764764
765765 def test_write (self , write_data001 : tagWriteData001 , os_ops : OsOperations ):
766- assert type (write_data001 ) == __class__ .tagWriteData001 # noqa: E721
766+ assert type (write_data001 ) is __class__ .tagWriteData001
767767 assert isinstance (os_ops , OsOperations )
768768
769769 mode = "w+b" if write_data001 .call_param__binary else "w+"
@@ -847,7 +847,7 @@ def test_is_port_free__false(self, os_ops: OsOperations):
847847
848848 def LOCAL_server (s : socket .socket ):
849849 assert s is not None
850- assert type (s ) == socket .socket # noqa: E721
850+ assert type (s ) is socket .socket
851851
852852 try :
853853 while True :
@@ -873,7 +873,7 @@ def LOCAL_server(s: socket.socket):
873873
874874 s .listen (10 )
875875
876- assert type (th ) == threading .Thread # noqa: E721
876+ assert type (th ) is threading .Thread
877877 th .start ()
878878
879879 try :
@@ -964,7 +964,7 @@ def data001(self, request: pytest.FixtureRequest) -> tagData_OS_OPS__NUMS:
964964 return request .param
965965
966966 def test_mkdir__mt (self , data001 : tagData_OS_OPS__NUMS ):
967- assert type (data001 ) == __class__ .tagData_OS_OPS__NUMS # noqa: E721
967+ assert type (data001 ) is __class__ .tagData_OS_OPS__NUMS
968968
969969 N_WORKERS = 4
970970 N_NUMBERS = data001 .nums
@@ -1261,7 +1261,7 @@ def test_kill(
12611261 )
12621262
12631263 assert proc is not None
1264- assert type (proc ) == subprocess .Popen # noqa: E721
1264+ assert type (proc ) is subprocess .Popen
12651265 proc_pid = proc .pid
12661266 assert type (proc_pid ) is int
12671267 logging .info ("Test process pid is {}" .format (proc_pid ))
@@ -1332,7 +1332,7 @@ def test_kill__unk_pid(
13321332 )
13331333
13341334 assert proc is not None
1335- assert type (proc ) == subprocess .Popen # noqa: E721
1335+ assert type (proc ) is subprocess .Popen
13361336 proc_pid = proc .pid
13371337 assert type (proc_pid ) is int
13381338 logging .info ("Test process pid is {}" .format (proc_pid ))
@@ -1387,10 +1387,10 @@ def test_kill__unk_pid(
13871387 logging .info ("Our exception has type [{}]" .format (type (x .value ).__name__ ))
13881388
13891389 if type (os_ops ).__name__ == "LocalOsOperations" :
1390- assert type (x .value ) == ProcessLookupError # noqa: E721
1390+ assert type (x .value ) is ProcessLookupError
13911391 assert "No such process" in str (x .value )
13921392 elif type (os_ops ).__name__ == "RemoteOsOperations" :
1393- assert type (x .value ) == ExecUtilException # noqa: E721
1393+ assert type (x .value ) is ExecUtilException
13941394 assert "No such process" in str (x .value )
13951395 else :
13961396 RuntimeError ("Unknown os_ops type: {}" .format (type (os_ops ).__name__ ))
0 commit comments