Amber-MD / pytraj

Python interface of cpptraj
https://amber-md.github.io/pytraj
170 stars 38 forks source link

Internal Cpptraj Error not counted as test error. #1552

Open drroe opened 4 years ago

drroe commented 4 years ago

This is a placeholder so I don't forget about it. When running tests, the test_trajectory_writer test reports an internal cpptraj error but soldiers on. I'm not sure if this is a real failure or not, but seems like it should be addressed.

test_trajectory/test_trajectory_iterator.py::TestTrajectoryIterator::test_sorting_filelist PASSED
test_trajectory/test_trajectory_iterator.py::TestTrajectoryIterator::test_comprehensive PASSED
test_trajectory/test_trajectory_writer.py::test_trajectory_writer_open_close Internal Error: TrajoutList::AddTrajout() called with empty filename.
Error: Could not determine trajectory '/tmp/tmpxs3uv9t3/test.x' format.
Error: Could not set up trajectory '/tmp/tmpxs3uv9t3/test.x'
PASSED
test_trajectory/test_trajectory_writer.py::test_trajectory_writer__with_statement PASSED
hainm commented 4 years ago

yeah, the error comes from this line of code: https://github.com/Amber-MD/pytraj/blob/66e181535900dbac6befb357302a3bf8f6c6ceb3/tests/test_trajectory/test_trajectory_writer.py#L16

The filename is empty (https://github.com/Amber-MD/pytraj/blob/30b60f8b05b6f27b07b88a68171a2745b49089ba/pytraj/trajectory/c_traj/c_trajout.pyx#L12).

But I agree that cpptraj should raise an error.