Skip to content

Commit

Permalink
Test pairing to multiple formats using a config file (#777)
Browse files Browse the repository at this point in the history
  • Loading branch information
mwouts authored May 2, 2021
1 parent 086f2f5 commit 0292460
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions tests/test_cli_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -174,3 +174,24 @@ def test_sync_config_does_not_create_formats_metadata(

nb = read("test.py")
assert "formats" not in nb.metadata["jupytext"]


def test_multiple_formats_771(tmpdir, cwd_tmpdir, python_notebook):
tmpdir.join("jupytext.toml").write(
"""formats = "notebooks///ipynb,notebooks///py,scripts///py:percent"
"""
)
notebooks_dir = tmpdir.mkdir("notebooks")
scripts_dir = tmpdir.join("scripts")

write(python_notebook, str(notebooks_dir.join("notebook.ipynb")))
jupytext(["--sync", "notebooks/notebook.ipynb"])

assert notebooks_dir.join("notebook.py").isfile()
assert scripts_dir.join("notebook.py").isfile()

notebooks_dir.join("module.py").write("1 + 1\n")
jupytext(["--sync", "notebooks/module.py"])

assert notebooks_dir.join("module.ipynb").isfile()
assert scripts_dir.join("module.py").isfile()

0 comments on commit 0292460

Please sign in to comment.