@@ -12,7 +12,7 @@ def foo(a):
12
12
a [dpex .get_global_id (0 )] = 0
13
13
14
14
15
- def test_opt_warning (caplog ):
15
+ def test_opt_warning ():
16
16
bkp = config .DPEX_OPT
17
17
config .DPEX_OPT = 3
18
18
@@ -22,7 +22,7 @@ def test_opt_warning(caplog):
22
22
config .DPEX_OPT = bkp
23
23
24
24
25
- def test_inline_warning ( caplog ):
25
+ def test_inline_threshold_eq_3_warning ( ):
26
26
bkp = config .INLINE_THRESHOLD
27
27
config .INLINE_THRESHOLD = 3
28
28
@@ -32,7 +32,27 @@ def test_inline_warning(caplog):
32
32
config .INLINE_THRESHOLD = bkp
33
33
34
34
35
- def test_no_warning (caplog ):
35
+ def test_inline_threshold_negative_val_warning_ ():
36
+ bkp = config .INLINE_THRESHOLD
37
+ config .INLINE_THRESHOLD = - 1
38
+
39
+ with pytest .warns (UserWarning ):
40
+ foo [dpex .Range (10 )](dpnp .arange (10 ))
41
+
42
+ config .INLINE_THRESHOLD = bkp
43
+
44
+
45
+ def test_inline_threshold_gt_3_warning ():
46
+ bkp = config .INLINE_THRESHOLD
47
+ config .INLINE_THRESHOLD = 4
48
+
49
+ with pytest .warns (UserWarning ):
50
+ foo [dpex .Range (10 )](dpnp .arange (10 ))
51
+
52
+ config .INLINE_THRESHOLD = bkp
53
+
54
+
55
+ def test_no_warning ():
36
56
with warnings .catch_warnings ():
37
57
warnings .simplefilter ("error" )
38
58
foo [dpex .Range (10 )](dpnp .arange (10 ))
0 commit comments