From 1c758bd939c3c10777b3584039cc25e7881e1c0c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Oct 2024 02:09:20 +0000 Subject: [PATCH] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- tests/test_lammps_spin.py | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/tests/test_lammps_spin.py b/tests/test_lammps_spin.py index 5bdc0506..d3d58920 100644 --- a/tests/test_lammps_spin.py +++ b/tests/test_lammps_spin.py @@ -6,6 +6,7 @@ import numpy as np from context import dpdata + from dpdata.lammps.dump import get_spin TRAJ_NO_ID = """ITEM: TIMESTEP @@ -127,7 +128,7 @@ def test_read_dump_spin(self): if os.path.isdir("lammps/dump"): shutil.rmtree("lammps/dump") - + def test_read_dump_partial_spin(self): # test if dpdata can read the spins when the spin data is not complete with self.assertWarns(UserWarning) as cm: @@ -138,12 +139,15 @@ def test_read_dump_partial_spin(self): input_file="lammps/in.lmp", ) self.assertTrue("spins" not in tmp_system.data) - + self.assertIn("Warning: spin info is not found in frame", str(cm.warning)) - + def test_get_spin_failed(self): with self.assertWarns(UserWarning) as cm: - spin = get_spin(TRAJ_NO_ID.split("\n"),["c_spin[1]", "c_spin[2]", "c_spin[3]", "c_spin[4]"]) + spin = get_spin( + TRAJ_NO_ID.split("\n"), + ["c_spin[1]", "c_spin[2]", "c_spin[3]", "c_spin[4]"], + ) self.assertTrue(spin is None) - - self.assertIn("Error processing spin data:", str(cm.warning)) \ No newline at end of file + + self.assertIn("Error processing spin data:", str(cm.warning))