Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add pytest basic tests and fix import to be coherent with README #3

Merged
merged 5 commits into from
Sep 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ jobs:
- name: Import the package
shell: bash -l {0}
run: python -c "import resolve_robotics_uri_py"

- name: Run the Python tests
shell: bash -l {0}
run: pytest

# This test requires the conda-forge::icub-models,
# robotology::ergocub-software and
Expand Down
1 change: 1 addition & 0 deletions ci_env.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ channels:
dependencies:
- python
- pip
- pytest
# packages that ship URDFs used to test
- icub-models
- ergocub-software
Expand Down
1 change: 1 addition & 0 deletions src/resolve_robotics_uri_py/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .resolve_robotics_uri_py import resolve_robotics_uri
6 changes: 6 additions & 0 deletions test/test_resolve_robotics_uri_py.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import resolve_robotics_uri_py
import pytest

def test_non_existing_file():
with pytest.raises(FileNotFoundError):
resolve_robotics_uri_py.resolve_robotics_uri("package://this/package/and/file/does/not.exist")