Skip to content

Commit

Permalink
Tests should work in the absence of a kernel (#921)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts authored Feb 10, 2022
1 parent 0182238 commit 8cfa66b
Show file tree
Hide file tree
Showing 7 changed files with 40 additions and 4 deletions.
24 changes: 24 additions & 0 deletions .github/workflows/continuous-integration.yml
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,30 @@ jobs:
- name: Upload coverage
uses: codecov/codecov-action@v1

test-pip-no-kernel:
needs: skip_duplicate
if: ${{ needs.skip_duplicate.outputs.should_skip == 'false' }}
strategy:
matrix:
python-version: [ 3.7 ]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-dev.txt
- name: Test with pytest
run: pytest --cov=./ --cov-report=xml
- name: Upload coverage
uses: codecov/codecov-action@v1

build:
name: Build
runs-on: ubuntu-latest
Expand Down
2 changes: 1 addition & 1 deletion codecov.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
comment:
after_n_builds: 8
after_n_builds: 9

coverage:
status:
Expand Down
9 changes: 8 additions & 1 deletion docs/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,11 +1,18 @@
Jupytext ChangeLog
==================

1.13.8 (2022-02-??)
-------------------

**Fixed**
- We made sure that our tests also work in absence of a Python kernel ([#906](https://github.com/mwouts/jupytext/issues/906))


1.13.7 (2022-02-09)
-------------------

**Fixed**
- The Jupytext CLI only suggest --update when the target is an .ipynb file ([#905](https://github.com/mwouts/jupytext/issues/905)) - thanks to [st--](https://github.com/st--) for this contribution
- The Jupytext CLI only suggest `--update` when the target is an .ipynb file ([#905](https://github.com/mwouts/jupytext/issues/905)) - thanks to [st--](https://github.com/st--) for this contribution
- We made sure that commands like `cat notebook.md | jupytext --execute` work ([#908](https://github.com/mwouts/jupytext/issues/908))

**Added**
Expand Down
2 changes: 1 addition & 1 deletion jupytext/version.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
"""Jupytext's version number"""

__version__ = "1.13.7"
__version__ = "1.13.8-dev"
2 changes: 2 additions & 0 deletions tests/test_contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
requires_pandoc,
requires_quarto,
requires_sphinx_gallery,
requires_user_kernel_python3,
)


Expand Down Expand Up @@ -1215,6 +1216,7 @@ def test_global_pairing_allows_to_save_other_file_types(nb_file, tmpdir):
compare_notebooks(nb2, nb)


@requires_user_kernel_python3
@pytest.mark.parametrize("nb_file", list_notebooks("R"))
def test_python_kernel_preserves_R_files(nb_file, tmpdir):
"""Opening a R file with a Jupyter server that has no R kernel should not modify the file"""
Expand Down
2 changes: 2 additions & 0 deletions tests/test_execute.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ def sample_md_notebook():
"""


@requires_user_kernel_python3
def test_execute_text_file_does_update_the_metadata(sample_md_notebook, tmp_path):
md_file = tmp_path / "nb.md"
md_file.write_text(sample_md_notebook)
Expand All @@ -274,6 +275,7 @@ def test_execute_text_file_does_update_the_metadata(sample_md_notebook, tmp_path
assert "kernelspec" in new_md_text


@requires_user_kernel_python3
def test_cat_execute_does_not_update_the_metadata(sample_md_notebook, tmp_path):
md_file = tmp_path / "nb.md"
md_file.write_text(sample_md_notebook)
Expand Down
3 changes: 2 additions & 1 deletion tests/test_using_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,12 @@
import jupytext
from jupytext.cli import jupytext as jupytext_cli

from .utils import requires_black, requires_myst
from .utils import requires_black, requires_myst, requires_user_kernel_python3

doc_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), "..", "docs")


@requires_user_kernel_python3
@requires_black
@requires_myst
@pytest.mark.skipif(
Expand Down

0 comments on commit 8cfa66b

Please sign in to comment.