File tree Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Expand file tree Collapse file tree 3 files changed +8
-0
lines changed Original file line number Diff line number Diff line change @@ -76,6 +76,7 @@ def test_context_not_equals():
76
76
except ValueError :
77
77
pytest .skip ()
78
78
assert ctx_cpu != ctx_gpu
79
+ assert hash (ctx_cpu ) != hash (ctx_gpu )
79
80
80
81
81
82
def test_context_not_equals2 ():
@@ -94,6 +95,7 @@ def test_context_equals():
94
95
except ValueError :
95
96
pytest .skip ()
96
97
assert ctx0 == ctx1
98
+ assert hash (ctx0 ) == hash (ctx1 )
97
99
98
100
99
101
def test_name ():
Original file line number Diff line number Diff line change @@ -615,6 +615,7 @@ def test_filter_string_property():
615
615
dev_id = d .filter_string
616
616
d_r = dpctl .SyclDevice (dev_id )
617
617
assert d == d_r
618
+ assert hash (d ) == hash (d_r )
618
619
619
620
620
621
def test_filter_string_method ():
@@ -631,6 +632,9 @@ def test_filter_string_method():
631
632
)
632
633
d_r = dpctl .SyclDevice (dev_id )
633
634
assert d == d_r , "Failed "
635
+ assert hash (d ) == hash (
636
+ d_r
637
+ ), "Hash equality is inconsistent with __eq__"
634
638
635
639
636
640
def test_hashing_of_device ():
Original file line number Diff line number Diff line change @@ -358,6 +358,7 @@ def test_context_not_equals():
358
358
pytest .skip ()
359
359
ctx_cpu = cpuQ .get_sycl_context ()
360
360
assert ctx_cpu != ctx_gpu
361
+ assert hash (ctx_cpu ) != hash (ctx_gpu )
361
362
362
363
363
364
def test_context_equals ():
@@ -369,6 +370,7 @@ def test_context_equals():
369
370
ctx0 = gpuQ0 .get_sycl_context ()
370
371
ctx1 = gpuQ1 .get_sycl_context ()
371
372
assert ctx0 == ctx1
373
+ assert hash (ctx0 ) == hash (ctx1 )
372
374
373
375
374
376
def test_hashing_of_queue ():
You can’t perform that action at this time.
0 commit comments