Skip to content
This repository was archived by the owner on Nov 4, 2024. It is now read-only.

Commit 40064fa

Browse files
committed
Add tests
1 parent ba887a6 commit 40064fa

File tree

5 files changed

+22
-8
lines changed

5 files changed

+22
-8
lines changed

.github/workflows/pypi-release.yaml

+2-2
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
run: |
3434
python -m twine check dist/*
3535
pwd
36-
if [ -f dist/unison-0.0.0.tar.gz ]; then
36+
if [ -f dist/esds-unison-0.0.0.tar.gz ]; then
3737
echo "❌ INVALID VERSION NUMBER"
3838
exit 1
3939
else
@@ -65,7 +65,7 @@ jobs:
6565
if: github.event_name == 'push'
6666
run: |
6767
python -m pip install --upgrade pip
68-
python -m pip install dist/unison*.whl
68+
python -m pip install dist/esds-unison*.whl
6969
# python -c "import unison; print(unison.__version__)"
7070
7171
upload-to-pypi:

tests/test_main.py

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import pathlib
2+
3+
import pytest
4+
5+
import unison
6+
7+
8+
@pytest.fixture(scope='module')
9+
def runner():
10+
return unison.Unison()
11+
12+
13+
def test_get_conda_kernel_path(runner):
14+
assert runner.get_conda_kernel_path('py36') is None
15+
assert isinstance(runner.get_conda_kernel_path('unison-dev'), pathlib.Path)

tests/test_sample.py

-2
This file was deleted.

unison/__init__.py

+3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1+
# flake8: noqa
12
from pkg_resources import DistributionNotFound, get_distribution
23

4+
from .main import Unison
5+
36
try:
47
__version__ = get_distribution(__name__).version
58
except DistributionNotFound: # pragma: no cover

unison/main.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,8 @@ def get_conda_kernel_path(self, env_name) -> str | None:
2323
env = pathlib.Path(env)
2424
if env.stem == env_name:
2525
return env
26-
except Exception:
27-
pass
28-
29-
finally:
26+
except Exception as exc:
27+
console.print(f'Error getting conda kernel path: {exc}')
3028
return None
3129

3230
def set_kernel_name(

0 commit comments

Comments
 (0)