@@ -65,7 +65,6 @@ class MyDevice(Device):
6565
6666 # Since they're the same object, they're equal
6767 assert device == my_device
68- assert not (device != my_device )
6968
7069
7170def test_stream_subclass_equality (init_cuda ):
@@ -87,20 +86,17 @@ class MyStream(Stream):
8786 # Create another Stream wrapping same handle
8887 stream2 = Stream .from_handle (int (stream .handle ))
8988 assert stream == stream2 , "Streams wrapping same handle are equal"
90- assert not (stream != stream2 )
9189
9290 # Create subclass instance with different handle
9391 my_stream = MyStream ._init (options = StreamOptions (), device_id = device .device_id )
9492
9593 # Different handles -> not equal
9694 assert stream != my_stream , "Streams with different handles are not equal"
97- assert not (stream == my_stream )
9895 assert stream .handle != my_stream .handle
9996
10097 # sanity check: base and subclass compare equal (and hash equal)
10198 stream_from_handle = MyStream .from_handle (int (my_stream .handle ))
10299 assert my_stream == stream_from_handle , "MyStream and Stream wrapping same handle compare equal"
103- assert not (my_stream != stream_from_handle )
104100 assert hash (my_stream ) == hash (stream_from_handle )
105101
106102
@@ -122,7 +118,6 @@ class MyEvent(Event):
122118
123119 # Different events should not be equal (different handles)
124120 assert event != my_event , "Different Event instances are not equal"
125- assert not (event == my_event )
126121
127122 # Same subclass type with different handles
128123 my_event2 = MyEvent ._init (device .device_id , device .context , options = EventOptions ())
@@ -147,7 +142,6 @@ class MyContext(Context):
147142
148143 # Since both are Context instances with same handle, they're equal
149144 assert context == my_context , "Context instances with same handle are equal"
150- assert not (context != my_context )
151145
152146 # Create another context from different stream
153147 stream2 = device .create_stream ()
0 commit comments