Files
OpenBB/.github/scripts/noxfile.py
montezdesousa ecede0b4e4 [BugFix] Release fixes (#6560)
* Bump openbb version

* Small fixes

* update version

* Add python 3.12 to noxfile

* ^

* python 3.12 compatibility fixes

* fix typing

* fix currency snapshots

* black

* Enable test collection on 3.12

* Update mock called once assertion syntax

* remove logging assertion

* fix command runner chart assertion

---------

Co-authored-by: Theodore Aptekarev <aptekarev@gmail.com>
2024-07-02 19:33:11 +00:00

48 lines
1.2 KiB
Python

"""Nox sessions."""
from pathlib import Path
import nox
ROOT_DIR = Path(__file__).parent.parent.parent
PLATFORM_DIR = ROOT_DIR / "openbb_platform"
PLATFORM_TESTS = [
str(PLATFORM_DIR / p) for p in ["tests", "core", "providers", "extensions"]
]
CLI_DIR = ROOT_DIR / "cli"
CLI_TESTS = CLI_DIR / "tests"
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
def unit_test_platform(session):
"""Run the test suite."""
session.install("poetry", "toml")
session.run(
"python",
str(PLATFORM_DIR / "dev_install.py"),
"-e",
"all",
external=True,
)
session.install("pytest")
session.install("pytest-cov")
session.run(
"pytest", *PLATFORM_TESTS, f"--cov={PLATFORM_DIR}", "-m", "not integration"
)
@nox.session(python=["3.9", "3.10", "3.11", "3.12"])
def unit_test_cli(session):
"""Run the test suite."""
session.install("poetry", "toml")
session.run(
"python",
str(PLATFORM_DIR / "dev_install.py"),
"-e",
"all",
external=True,
)
session.install("pytest")
session.install("pytest-cov")
session.run("pytest", CLI_TESTS, f"--cov={CLI_DIR}")