Skip to content

Commit

Permalink
make notebooks/ a subpackage - importlib.resources.path expect `(…
Browse files Browse the repository at this point in the history
…package, file)` and not `(package, directories)` (tho it doesnt fail for py37 it is documented)
  • Loading branch information
murilo-cunha committed Dec 21, 2021
1 parent ea68ed3 commit c0cdbec
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 5 deletions.
Empty file added tests/notebooks/__init__.py
Empty file.
7 changes: 2 additions & 5 deletions tests/test_data_models/test_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,11 +204,8 @@ def test_notebook_sub(self) -> None:

def test_parse_file() -> None:
"""Deserialize `ipynb` file to `databooks.JupyterNotebook` models."""
with resources.path("tests", "notebooks") as nb_dir:
nb_path = nb_dir / "demo.ipynb"
assert nb_path.is_file()

notebook = JupyterNotebook.parse_file(nb_path)
with resources.path("tests.notebooks", "demo.ipynb") as nb_path:
notebook = JupyterNotebook.parse_file(nb_path)

assert notebook.nbformat == 4
assert notebook.nbformat_minor == 5
Expand Down

0 comments on commit c0cdbec

Please sign in to comment.