Skip to content

Commit db1f7a9

Browse files
committed
Update test
1 parent 91e85c3 commit db1f7a9

File tree

1 file changed

+4
-12
lines changed

1 file changed

+4
-12
lines changed

tests/test_elements.py

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,8 @@
77

88
def test_drift():
99

10-
for CTX in xo.ContextCpu, xo.ContextPyopencl, xo.ContextCupy:
11-
if CTX not in available:
12-
continue
13-
14-
print(f"Test {CTX}")
15-
ctx = CTX()
10+
for ctx in xo.context.get_test_contexts():
11+
print(f"Test {ctx.__class__}")
1612

1713
pyst_particle = xl.Particles(
1814
p0c=25.92e9,
@@ -40,12 +36,8 @@ def test_drift():
4036

4137
def test_elens():
4238

43-
for CTX in xo.ContextCpu, xo.ContextPyopencl, xo.ContextCupy:
44-
if CTX not in available:
45-
continue
46-
47-
print(f"Test {CTX}")
48-
ctx = CTX()
39+
for ctx in xo.context.get_test_contexts():
40+
print(f"Test {ctx.__class__}")
4941

5042
pyst_particle = xl.Particles(
5143
p0c=np.array([7000e9]),

0 commit comments

Comments
 (0)