mirror of
https://github.com/OpenFreeEnergy/openfe.git
synced 2026-06-05 06:44:24 +08:00
* add more checks * make precommit manual * apply formatting to pyproject.toml * add TODO * remove unneeded, add a few more * add ruff, but turn everything off * add openfe known first party * format highest-level files * first half of openfe protocols * second half of openfe protocols * openfe protocols formatting, with alyssa's fmt skips * add ruff formatter to precommit * fmt: off all vendored _rfe_utils code * addressing review comments * format openfe/utils * format openfe/setup * first batch of cli formatting * second batch of cli formatting * formatting the rest of openfecli commands * format openfecli/parameters * format openfe/storage * run precommit * Update openfecli/commands/gather.py Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com> * update example notebooks branch for v1.7.0 docs changes (#1615) * bump example notebooks branch * add ipykernel to env * roll back to fixing septop branch * i dont think we want ipykernel * bump to tmp_fix_docs branch * point to branch revert-237-v1.7_cookbooks * point to latest example notebooks release * remove colab button, point to updated example notebooks, reorg landing page (#1618) * remove colab button from example notebooks in docs * point to example notebooks 2025.10.2 * replace 'try' with CLI --------- Co-authored-by: Irfan Alibay <IAlibay@users.noreply.github.com>
41 lines
1.3 KiB
Python
41 lines
1.3 KiB
Python
import click
|
|
from openfecli import OFECommandPlugin
|
|
import sys
|
|
|
|
import pytest
|
|
import os
|
|
|
|
from openfecli.utils import write
|
|
|
|
|
|
@click.command("test", short_help="Run the OpenFE test suite")
|
|
@click.option('--long', is_flag=True, default=False, help="Run additional tests (takes much longer)") # fmt: skip
|
|
def test(long):
|
|
"""
|
|
Run the OpenFE test suite. This first checks that OpenFE is correctly
|
|
imported, and then runs the main test suite, which should take several
|
|
minutes. If given the ``--long`` flag, this will include several tests
|
|
that take significantly longer, but ensure that we're able to fully run
|
|
in your environment.
|
|
|
|
A successful run will include tests that pass, skip, or "xfail". In many
|
|
terminals, these show as green or yellow. Warnings are not a concern.
|
|
However, You should not see anything that fails or errors (red).
|
|
"""
|
|
try:
|
|
old_env = dict(os.environ)
|
|
os.environ["OFE_SLOW_TESTS"] = str(long)
|
|
|
|
write("Testing can import....")
|
|
import openfe
|
|
|
|
write("Running the main package tests")
|
|
return_value = pytest.main(["-v", "--pyargs", "openfe", "--pyargs", "openfecli"])
|
|
finally:
|
|
os.environ.clear()
|
|
os.environ.update(old_env)
|
|
sys.exit(return_value)
|
|
|
|
|
|
PLUGIN = OFECommandPlugin(test, "Miscellaneous", requires_ofe=(0, 7, 5))
|