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():
7676 except ValueError :
7777 pytest .skip ()
7878 assert ctx_cpu != ctx_gpu
79+ assert hash (ctx_cpu ) != hash (ctx_gpu )
7980
8081
8182def test_context_not_equals2 ():
@@ -94,6 +95,7 @@ def test_context_equals():
9495 except ValueError :
9596 pytest .skip ()
9697 assert ctx0 == ctx1
98+ assert hash (ctx0 ) == hash (ctx1 )
9799
98100
99101def test_name ():
Original file line number Diff line number Diff line change @@ -615,6 +615,7 @@ def test_filter_string_property():
615615 dev_id = d .filter_string
616616 d_r = dpctl .SyclDevice (dev_id )
617617 assert d == d_r
618+ assert hash (d ) == hash (d_r )
618619
619620
620621def test_filter_string_method ():
@@ -631,6 +632,9 @@ def test_filter_string_method():
631632 )
632633 d_r = dpctl .SyclDevice (dev_id )
633634 assert d == d_r , "Failed "
635+ assert hash (d ) == hash (
636+ d_r
637+ ), "Hash equality is inconsistent with __eq__"
634638
635639
636640def test_hashing_of_device ():
Original file line number Diff line number Diff line change @@ -358,6 +358,7 @@ def test_context_not_equals():
358358 pytest .skip ()
359359 ctx_cpu = cpuQ .get_sycl_context ()
360360 assert ctx_cpu != ctx_gpu
361+ assert hash (ctx_cpu ) != hash (ctx_gpu )
361362
362363
363364def test_context_equals ():
@@ -369,6 +370,7 @@ def test_context_equals():
369370 ctx0 = gpuQ0 .get_sycl_context ()
370371 ctx1 = gpuQ1 .get_sycl_context ()
371372 assert ctx0 == ctx1
373+ assert hash (ctx0 ) == hash (ctx1 )
372374
373375
374376def test_hashing_of_queue ():
You can’t perform that action at this time.
0 commit comments