Make sure Python tests run unbuffered so PyLammps works

This commit is contained in:
Richard Berger 2020-09-16 11:28:38 -04:00
parent ca24806f4c
commit 9cdd35e625
No known key found for this signature in database
GPG Key ID: A9E83994E0BA0CAB
2 changed files with 3 additions and 2 deletions

View File

@ -32,9 +32,9 @@ if (Python_EXECUTABLE)
find_package_handle_standard_args(COVERAGE DEFAULT_MSG COVERAGE_BINARY)
if(COVERAGE_FOUND)
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE} ${COVERAGE_BINARY} run --parallel-mode --include=${LAMMPS_PYTHON_DIR}/lammps.py --omit=${LAMMPS_PYTHON_DIR}/install.py)
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE} -u ${COVERAGE_BINARY} run --parallel-mode --include=${LAMMPS_PYTHON_DIR}/lammps.py --omit=${LAMMPS_PYTHON_DIR}/install.py)
else()
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE})
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE} -u)
endif()
else()
set(PYTHON_TEST_RUNNER ${Python_EXECUTABLE})

View File

@ -44,6 +44,7 @@ class PythonPyLammps(unittest.TestCase):
types = [1, 1]
self.assertEqual(self.pylmp.lmp.create_atoms(2, id=None, type=types, x=x), 2)
self.assertEqual(self.pylmp.system.natoms, 2)
if __name__ == "__main__":
unittest.main()