-
Notifications
You must be signed in to change notification settings - Fork 208
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
CLI: Fix bug in
verdi data core.trajectory show
for various formats (…
…#5394) These minor bugs went unnoticed because the methods are wholly untested. This is partly because they rely on additional Python modules or external executables. For the formats that rely on external executables, i.e., `jmol` and `xcrysden`, the `subprocess.check_output` function is monkeypatched to prevent the actual executable from being called. This tests all code except for the actual external executable, which at least gives coverage of our code. The test for `mpl_pos` needed to be monkeypatched as well. This is because the `_show_mpl_pos` method calls `plot_positions_xyz` which imports `matplotlib.pyplot` and for some completely unknown reason, this causes `tests/storage/psql_dos/test_backend.py::test_unload_profile` to fail. For some reason, merely importing `matplotlib` (even here directly in the test) will cause that test to claim that there still is something holding on to a reference of an sqlalchemy session that it keeps track of in the `sqlalchemy.orm.session._sessions` weak ref dictionary. Since it is impossible to figure out why the hell importing matplotlib would interact with sqlalchemy sessions, the function that does the import is simply mocked out for now. Co-authored-by: Sebastiaan Huber <mail@sphuber.net>
- Loading branch information
Showing
4 changed files
with
106 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters