Skip to content

Commit

Permalink
fix failing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
blink1073 committed Oct 6, 2022
1 parent 1ffe5e9 commit b3a3c5d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
pip freeze
pip check
- name: Run tests with coverage
- name: Run tests on MacOS
if: ${{ startsWith(runner.os, 'macos') }}
shell: bash -l {0}
run: |
Expand All @@ -76,15 +76,14 @@ jobs:
pip install -U websockets
python -m pytest --cov nbconvert -vv
- name: Run tests on pypy and Windows
- name: Run tests on Linux
if: ${{ startsWith(runner.os, 'linux') }}
shell: bash -l {0}
run: |
conda activate nbconvert
# See https://github.com/pyppeteer/pyppeteer/pull/321
pip install -U websockets
#python -m pytest -vv
xvfb-run --auto-servernum `which coverage` run -m pytest -vv
NBFORMAT_VALIDATOR=jsonschema xvfb-run --auto-servernum `which coverage` run -m pytest -vv
- name: Run tests on pypy and Windows
if: ${{ startsWith(runner.os, 'Windows') }}
Expand Down Expand Up @@ -136,6 +135,7 @@ jobs:
uses: jupyterlab/maintainer-tools/.github/actions/install-minimums@v1
- name: Run the unit tests
run: |
export NBFORMAT_VALIDATOR=jsonschema
pytest -vv -W default || pytest -vv -W default --lf
test_prereleases:
Expand All @@ -158,7 +158,7 @@ jobs:
run: |
pip install jupyter_client@https://github.com/blink1073/jupyter_client/archive/refs/heads/synchronous_managers.zip
pip install nbclient==0.7.0
pytest -vv || pytest -vv --lf
pytest -vv -W default || pytest -vv -W default --lf
make_sdist:
name: Make SDist
Expand Down
1 change: 1 addition & 0 deletions nbconvert/exporters/tests/test_latex.py
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,7 @@ def test_svg(self):
Can a LatexExporter export when it recieves raw binary strings form svg?
"""
filename = os.path.join(current_dir, "files", "svg.ipynb")

(output, resources) = LatexExporter().from_filename(filename)
assert len(output) > 0

Expand Down
2 changes: 2 additions & 0 deletions nbconvert/exporters/tests/test_rst.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,11 +40,13 @@ def test_empty_code_cell(self):
with open(nbname, encoding="utf8") as f:
nb = nbformat.read(f, 4)

nb = v4.upgrade(nb)
exporter = self.exporter_class()

(output, resources) = exporter.from_notebook_node(nb)
# add an empty code cell
nb.cells.append(v4.new_code_cell(source=""))

(output2, resources) = exporter.from_notebook_node(nb)
# adding an empty code cell shouldn't change output
self.assertEqual(output.strip(), output2.strip())
Expand Down
2 changes: 1 addition & 1 deletion nbconvert/preprocessors/svg2pdf.py
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,6 @@ def convert_figure(self, data_format, data):
if os.path.isfile(output_filename):
with open(output_filename, "rb") as f:
# PDF is a nb supported binary, data type, so base64 encode.
return base64.encodebytes(f.read())
return base64.encodebytes(f.read()).decode("utf-8")
else:
raise TypeError("Inkscape svg to pdf conversion failed")

0 comments on commit b3a3c5d

Please sign in to comment.