Skip to content

Commit d125028

Browse files
committed
Fix in RFSweep test: move particles to CPU context.
1 parent 7d87307 commit d125028

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

tests/test_rf_sweep.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import numpy as np
77
import pytest
88

9+
import xobjects as xo
910
import xtrack as xt
1011
import xcoll as xc
1112
from xobjects.test_helpers import for_all_test_contexts
@@ -41,6 +42,7 @@ def test_rf_sweep(sweep, beam, test_context):
4142

4243
# This sweep is 3.5 buckets, so check that all particles are at least 3 buckets away
4344
# negative sweep => positive off-momentum etc
45+
part.move(_context=xo.ContextCpu())
4446
if sweep < 0:
4547
assert np.all(part.delta > 3*bh)
4648
else:
@@ -67,4 +69,5 @@ def test_rf_sweep_old_style():
6769

6870
# This sweep is 3.5 buckets, so check that all particles are at least 3 buckets away
6971
# negative sweep => positive off-momentum etc
72+
part.move(_context=xo.ContextCpu())
7073
assert np.all(part.delta > 1.5e-3)

0 commit comments

Comments
 (0)