-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* chore: modify library config * chore: add licencecheck exceptions * chore: add pre-commit to tox * feat: add doctests to functions * fix: change paths printing in doctests
- Loading branch information
Showing
8 changed files
with
323 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
"""Fixtures for doctests.""" | ||
|
||
import urllib.request | ||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
LFS_DIRECTORY_URL = "https://github.com/kraina-ai/srai-test-files/raw/main/files/" | ||
|
||
|
||
@pytest.fixture(autouse=True) | ||
def add_pbf_files(doctest_namespace): # type: ignore | ||
"""Download PBF files used in doctests.""" | ||
extracts = ["monaco", "kiribati", "maldives"] | ||
download_directory = Path(__file__).parent / "files" | ||
download_directory.mkdir(parents=True, exist_ok=True) | ||
for extract_name in extracts: | ||
pbf_file_download_url = LFS_DIRECTORY_URL + f"{extract_name}-latest.osm.pbf" | ||
pbf_file_path = download_directory / f"{extract_name}.osm.pbf" | ||
urllib.request.urlretrieve(pbf_file_download_url, pbf_file_path) | ||
doctest_namespace[f"{extract_name}_pbf_path"] = pbf_file_path |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters