Skip to content

Commit

Permalink
Fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
antarcticrainforest committed Jul 5, 2024
1 parent 5130a73 commit 1e81160
Show file tree
Hide file tree
Showing 6 changed files with 14 additions and 11 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ deps = -c {toxinidir}/.github/dependabot/constraints.txt
-e .[dev]
commands =
python3 -m pytest -vv --cov=src --cov-report=html:coverage_report --junitxml report.xml --cov-report xml src/kernel_install/tests
python3 -m pytest -vv --cov=src --cov-report=html:coverage_report --junitxml report.xml --cov-report xml src/jupyter_kernel_install/tests
python3 -m coverage report --fail-under=98.5 --precision=2
[testenv:lint]
Expand Down
7 changes: 5 additions & 2 deletions src/jupyter_kernel_install/__main__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,10 @@
"""Command line interface for jupyter_kernel_install."""

import re
import sys
from jupyter_kernel_install.cli import cli

from .cli import cli

if __name__ == "__main__":
sys.argv[0] = re.sub(r"(-script\.pyw|\.exe)?$", "", sys.argv[0])
sys.exit(cli())
cli(sys.argv[1:])
2 changes: 1 addition & 1 deletion src/jupyter_kernel_install/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from rich import print as pprint
from rich_argparse import ArgumentDefaultsRichHelpFormatter

from kernel_install import __version__, install
from jupyter_kernel_install import __version__, install

from .install import __all__ as methods
from .logger import logger, logger_stream_handle
Expand Down
8 changes: 4 additions & 4 deletions src/jupyter_kernel_install/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,27 +5,27 @@

import pytest

import kernel_install
import jupyter_kernel_install


@pytest.fixture(scope="function")
def r_kernel() -> Iterator[Path]:
"""Set the name of the python kernel."""
out = kernel_install.install.KERNEL_DIR / "r_test"
out = jupyter_kernel_install.install.KERNEL_DIR / "r_test"
yield out


@pytest.fixture(scope="function")
def bash_kernel() -> Iterator[Path]:
"""Set the name of the python kernel."""
out = kernel_install.install.KERNEL_DIR / "bash_test"
out = jupyter_kernel_install.install.KERNEL_DIR / "bash_test"
yield out


@pytest.fixture(scope="function")
def python_kernel() -> Iterator[Path]:
"""Set the name of the python kernel."""
out = kernel_install.install.KERNEL_DIR / "python_test"
out = jupyter_kernel_install.install.KERNEL_DIR / "python_test"
yield out
for r in out.rglob("*.*"):
r.unlink()
Expand Down
2 changes: 1 addition & 1 deletion src/jupyter_kernel_install/tests/test_kernel_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

from pathlib import Path

from kernel_install.cli import cli
from jupyter_kernel_install.cli import cli


def test_cli(python_kernel: Path) -> None:
Expand Down
4 changes: 2 additions & 2 deletions src/jupyter_kernel_install/tests/test_kernel_creation.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
import mock
import pytest

from kernel_install import bash, python, r
from kernel_install.install import get_ld_library_path_from_bin
from jupyter_kernel_install import bash, python, r
from jupyter_kernel_install.install import get_ld_library_path_from_bin


def test_ld_library_path() -> None:
Expand Down

0 comments on commit 1e81160

Please sign in to comment.