From 95a24cc544e7fa99149db7d6cf33d16473b5e951 Mon Sep 17 00:00:00 2001 From: Jan Janssen Date: Mon, 13 Nov 2023 18:46:08 +0100 Subject: [PATCH] Make lammps test optional --- tests/test_optimize_positions_lammps.py | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tests/test_optimize_positions_lammps.py b/tests/test_optimize_positions_lammps.py index 70df8f64..f9ff5dd3 100644 --- a/tests/test_optimize_positions_lammps.py +++ b/tests/test_optimize_positions_lammps.py @@ -5,11 +5,20 @@ import unittest from atomistics.workflows.structure_optimization.workflow import optimize_positions -from atomistics.calculators.lammps import ( - evaluate_with_lammps, get_potential_dataframe -) +try: + from atomistics.calculators.lammps import ( + evaluate_with_lammps, get_potential_dataframe + ) + + skip_lammps_test = False +except ImportError: + skip_lammps_test = True + +@unittest.skipIf( + skip_lammps_test, "LAMMPS is not installed, so the LAMMPS tests are skipped." +) class TestOptimizePositionsLAMMPS(unittest.TestCase): def test_optimize_positions(self): potential = '1999--Mishin-Y--Al--LAMMPS--ipr1'