|
7 | 7 | from openff.toolkit.topology import Topology |
8 | 8 | from openff.toolkit.typing.engines.smirnoff import ForceField |
9 | 9 | from openff.units import unit |
10 | | -from openff.utilities.utilities import get_data_dir_path |
| 10 | +from openff.utilities.utilities import get_data_dir_path, temporary_cd |
11 | 11 | from openmm.openmm import System as OpenMMSystem |
12 | 12 |
|
13 | 13 | from openff.evaluator.datasets import PropertyPhase |
@@ -77,7 +77,9 @@ class TestEnthalpyOfMixing: |
77 | 77 | ], |
78 | 78 | ) |
79 | 79 | def test_mole_fractions_direct_simulation( |
80 | | - self, input_mole_fractions, output_mole_fractions, tmpdir |
| 80 | + self, |
| 81 | + input_mole_fractions, |
| 82 | + output_mole_fractions, |
81 | 83 | ): |
82 | 84 | """ |
83 | 85 | This test *only* checks the part where mole fractions are weighted. |
@@ -106,7 +108,7 @@ def test_mole_fractions_direct_simulation( |
106 | 108 | ) |
107 | 109 |
|
108 | 110 | physical_property = _get_dummy_enthalpy_of_mixing(substance) |
109 | | - with tmpdir.as_cwd(): |
| 111 | + with temporary_cd(): |
110 | 112 | here = pathlib.Path(".") |
111 | 113 |
|
112 | 114 | # generate force field and metadata |
@@ -191,7 +193,7 @@ def test_mole_fractions_direct_simulation( |
191 | 193 | output_mole_fractions[i] * 10, |
192 | 194 | ) |
193 | 195 |
|
194 | | - def test_expected_output_from_production_simulation(self, tmpdir): |
| 196 | + def test_expected_output_from_production_simulation(self): |
195 | 197 | """ |
196 | 198 | This is an integration test of sorts, |
197 | 199 | constructed to test expected mole fractions. See Issue #575. |
@@ -245,7 +247,7 @@ def test_expected_output_from_production_simulation(self, tmpdir): |
245 | 247 | ) |
246 | 248 |
|
247 | 249 | abs_path = data_directory.resolve() |
248 | | - with tmpdir.as_cwd(): |
| 250 | + with temporary_cd(): |
249 | 251 | tmp_path = pathlib.Path(".") |
250 | 252 | # copy data files over from data_directory |
251 | 253 | for path in abs_path.iterdir(): |
|
0 commit comments