Skip to content

Commit

Permalink
Fix and enable some doc tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jake-Moss committed May 15, 2024
1 parent 1c97bc9 commit a5f64f7
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 4 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ jobs:
- name: Test docstrings
run: |
# python -m pytest --doctest-modules ./aequilibrae --ignore=aequilibrae/distribution/setup_ipf.py --ignore=aequilibrae/paths/setup_assignment.py --doctest-continue-on-failure
python -m pytest --doctest-modules aequilibrae/log.py aequilibrae/parameters.py aequilibrae/paths/vdf.py
- name: Build documentation
run: |
Expand Down
3 changes: 2 additions & 1 deletion aequilibrae/log.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ class Log:
>>> from aequilibrae import Project
>>> project = Project.from_path("/tmp/test_project")
>>> project = Project()
>>> project.new(tmp_path_empty)
>>> log = project.log()
Expand Down
3 changes: 2 additions & 1 deletion aequilibrae/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ class Parameters:
>>> from aequilibrae import Project, Parameters
>>> project = Project.from_path("/tmp/test_project")
>>> project = Project()
>>> project.new(tmp_path_empty)
>>> p = Parameters(project)
Expand Down
9 changes: 8 additions & 1 deletion tests/aequilibrae/conftest.py → conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
from aequilibrae.utils.create_example import create_example
from aequilibrae.utils.spatialite_utils import ensure_spatialite_binaries

from ..data import siouxfalls_project
from tests.data import siouxfalls_project

DEFAULT_PROJECT = siouxfalls_project
ensure_spatialite_binaries()
Expand Down Expand Up @@ -98,3 +98,10 @@ def create_gtfs_project(create_path):
@pytest.fixture
def transit_conn(create_gtfs_project):
return database_connection("transit")


@pytest.fixture(autouse=True)
def doctest_fixtures(doctest_namespace, tmp_path, create_path):
doctest_namespace['tmp_path'] = tmp_path
doctest_namespace['tmp_path_empty'] = str(create_path)
print(doctest_namespace)

0 comments on commit a5f64f7

Please sign in to comment.