|
| 1 | +import math |
| 2 | + |
1 | 3 | import pytest |
2 | 4 | import sire as sr |
3 | 5 |
|
@@ -81,7 +83,7 @@ def test_tip3p_no_virtual_sites(tip3p_mols, openmm_platform): |
81 | 83 | assert bad_constraints == 0 |
82 | 84 |
|
83 | 85 | e = _potential_energy(omm) |
84 | | - assert e == e, "Potential energy is NaN" |
| 86 | + assert not math.isnan(e), "Potential energy is NaN" |
85 | 87 |
|
86 | 88 |
|
87 | 89 | @_skip_no_openmm |
@@ -118,7 +120,7 @@ def test_tip4p_virtual_sites(tip4p_mols, openmm_platform): |
118 | 120 | ), f"Particle {i}: expected ThreeParticleAverageSite, got {type(vs).__name__}" |
119 | 121 |
|
120 | 122 | e = _potential_energy(omm) |
121 | | - assert e == e, "Potential energy is NaN" |
| 123 | + assert not math.isnan(e), "Potential energy is NaN" |
122 | 124 |
|
123 | 125 |
|
124 | 126 | @_skip_no_openmm |
@@ -154,7 +156,7 @@ def test_opc_virtual_sites(opc_mols, openmm_platform): |
154 | 156 | ), f"Particle {i}: expected ThreeParticleAverageSite, got {type(vs).__name__}" |
155 | 157 |
|
156 | 158 | e = _potential_energy(omm) |
157 | | - assert e == e, "Potential energy is NaN" |
| 159 | + assert not math.isnan(e), "Potential energy is NaN" |
158 | 160 |
|
159 | 161 |
|
160 | 162 | @_skip_no_openmm |
@@ -192,4 +194,4 @@ def test_tip5p_virtual_sites(tip5p_mols, openmm_platform): |
192 | 194 | ), f"Particle {i}: expected OutOfPlaneSite, got {type(vs).__name__}" |
193 | 195 |
|
194 | 196 | e = _potential_energy(omm) |
195 | | - assert e == e, "Potential energy is NaN" |
| 197 | + assert not math.isnan(e), "Potential energy is NaN" |
0 commit comments