Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
davidbrochart committed Dec 19, 2024
1 parent 49fec25 commit c2d7da8
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import sys
from pathlib import Path
from subprocess import CalledProcessError, check_output
from unittest.mock import call, mock_open, patch
Expand All @@ -6,6 +7,11 @@

from nbclient.cli import NbClientApp

if sys.version_info >= (3, 13):
PATH_OPEN_CALL_STEP = 4
else:
PATH_OPEN_CALL_STEP = 3

current_dir = Path(__file__).parent.absolute()


Expand Down Expand Up @@ -60,7 +66,7 @@ def test_mult(input_names, relative, inplace, jupyterapp, client, reader, writer
# add suffix if needed
paths = [p.with_suffix(".ipynb") for p in paths]

assert path_open.mock_calls[::3] == [call(p) for p in paths]
assert path_open.mock_calls[::PATH_OPEN_CALL_STEP] == [call(p) for p in paths]
assert reader.call_count == len(paths)
# assert reader.mock_calls == [call(p, as_version=4) for p in paths]

Expand Down Expand Up @@ -114,7 +120,7 @@ def test_output(input_names, relative, output_base, jupyterapp, client, reader,
# add suffix if needed
paths = [p.with_suffix(".ipynb") for p in paths]

assert path_open.mock_calls[::3] == [call(p) for p in paths]
assert path_open.mock_calls[::PATH_OPEN_CALL_STEP] == [call(p) for p in paths]
assert reader.call_count == len(paths)

expected = []
Expand Down

0 comments on commit c2d7da8

Please sign in to comment.