File tree Expand file tree Collapse file tree 6 files changed +59
-0
lines changed Expand file tree Collapse file tree 6 files changed +59
-0
lines changed Original file line number Diff line number Diff line change 6262 source .venv/bin/activate
6363 python automations/my_automator.py setup dev-env
6464 python automations/my_automator.py build so
65+ python automations/my_automator.py build wheel
66+ pip install dist/*.whl
6567 python automations/my_automator.py build exe
6668
69+ - name : Run pytest
70+ run : |
71+ source .venv/bin/activate
72+ pip install pytest
73+ cd tests/
74+ pytest
75+
6776 - name : Upload artifact
6877 uses : actions/upload-artifact@v4
6978 with :
Original file line number Diff line number Diff line change 6262 python automations/my_automator.py build so
6363 python automations/my_automator.py build wheel
6464
65+ - name : Run pytest
66+ run : |
67+ source .venv/bin/activate
68+ pip install pytest
69+ cd tests/
70+ pytest
71+
6572 - name : Upload artifact
6673 uses : actions/upload-artifact@v4
6774 with :
Original file line number Diff line number Diff line change 1717import build_macos_wheel
1818import build_macos_exe
1919import build_macos_so
20+ import run_pytest
2021import dev_env
2122
2223
4647 "func" : build_macos_so .build_cmd_module
4748 }
4849 }
50+ },
51+ "test" : {
52+ "help" : "Runs all tests under the tests/ directory using pytest." ,
53+ "func" : run_pytest .run_pytest_suite
4954 }
5055}
5156
Original file line number Diff line number Diff line change 1+ import pathlib
2+ import subprocess
3+
4+ import const
5+
6+
7+ def run_pytest_suite ():
8+ """Runs the pytest suite."""
9+ subprocess .run (
10+ [pathlib .Path (const .PROJECT_ROOT_DIR / ".venv/bin/pytest" )],
11+ cwd = pathlib .Path (const .PROJECT_ROOT_DIR / "tests" )
12+ )
Original file line number Diff line number Diff line change 1+ """
2+ #A* -------------------------------------------------------------------
3+ #B* This file contains source code for running a simple example
4+ #C* Copyright 2025 by Martin Urban.
5+ #D* -------------------------------------------------------------------
6+ #E* It is unlawful to modify or remove this copyright notice.
7+ #F* -------------------------------------------------------------------
8+ #G* Please see the accompanying LICENSE file for further information.
9+ #H* -------------------------------------------------------------------
10+ #I* Additional authors of this source file include:
11+ #-*
12+ #-*
13+ #-*
14+ #Z* -------------------------------------------------------------------
15+ """
16+ import pathlib
17+
18+ from pymol import cmd
19+
20+ _FILEPATH = pathlib .Path (__file__ ).parent
21+
22+
23+ def test_fetch ():
24+ cmd .fetch ("3bmp" )
25+ assert pathlib .Path (_FILEPATH / "3bmp.cif" ).exists () is True
26+ assert cmd .get_model ("3bmp" ).atom [0 ].model == "3bmp"
You can’t perform that action at this time.
0 commit comments