From 00e2938eab47f516e3f06d09bdb4b2acfcf9ffc8 Mon Sep 17 00:00:00 2001 From: Marc Wouts Date: Mon, 20 Feb 2023 11:36:44 +0000 Subject: [PATCH] Use main for the default branch --- docs/CHANGELOG.md | 1 + tests/test_pre_commit_scripts.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index 532a5b3c8..b83ea694b 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -16,6 +16,7 @@ Jupytext ChangeLog **Changed** - Empty tags are not exported to the text notebook anymore ([#960](https://github.com/mwouts/jupytext/issues/960)) - We updated the `yarn.lock` file for the jupyter lab extension to address security vulnerabilities ([#1030](https://github.com/mwouts/jupytext/issues/1030), [#1036](https://github.com/mwouts/jupytext/issues/1036)) +- In the pre-commit tests we now use `main` for the main branch 1.14.4 (2022-12-11) diff --git a/tests/test_pre_commit_scripts.py b/tests/test_pre_commit_scripts.py index 7e014bf38..ae0116355 100644 --- a/tests/test_pre_commit_scripts.py +++ b/tests/test_pre_commit_scripts.py @@ -26,7 +26,7 @@ def git(*args): print(out) return out - git("init") + git("init", "--initial-branch", "main") git("status") git("config", "user.name", "jupytext-test-cli") git("config", "user.email", "jupytext@tests.com") @@ -66,7 +66,7 @@ def test_pre_commit_hook(tmpdir): git("commit", "-m", "created") git("status") - assert "nb with spaces.py" in git("ls-tree", "-r", "master", "--name-only") + assert "nb with spaces.py" in git("ls-tree", "-r", "main", "--name-only") assert os.path.isfile(tmp_py) @@ -94,8 +94,8 @@ def test_sync_with_pre_commit_hook(tmpdir): git("commit", "-m", "created") git("status") - assert "notebook.ipynb" in git("ls-tree", "-r", "master", "--name-only") - assert "notebook.md" not in git("ls-tree", "-r", "master", "--name-only") + assert "notebook.ipynb" in git("ls-tree", "-r", "main", "--name-only") + assert "notebook.md" not in git("ls-tree", "-r", "main", "--name-only") assert os.path.isfile(tmp_ipynb) assert not os.path.exists(tmp_md) @@ -113,8 +113,8 @@ def test_sync_with_pre_commit_hook(tmpdir): git("status") # The pre-commit script should have created and committed the md file - assert "notebook.ipynb" in git("ls-tree", "-r", "master", "--name-only") - assert "notebook.md" in git("ls-tree", "-r", "master", "--name-only") + assert "notebook.ipynb" in git("ls-tree", "-r", "main", "--name-only") + assert "notebook.md" in git("ls-tree", "-r", "main", "--name-only") assert os.path.isfile(tmp_md) nb_md = read(tmp_md) compare_notebooks(nb_md, nb) @@ -133,8 +133,8 @@ def test_sync_with_pre_commit_hook(tmpdir): git("status") # The pre-commit script should have sync and committed the ipynb file - assert "notebook.ipynb" in git("ls-tree", "-r", "master", "--name-only") - assert "notebook.md" in git("ls-tree", "-r", "master", "--name-only") + assert "notebook.ipynb" in git("ls-tree", "-r", "main", "--name-only") + assert "notebook.md" in git("ls-tree", "-r", "main", "--name-only") nb = read(tmp_ipynb) compare_cells( @@ -174,7 +174,7 @@ def test_pre_commit_hook_in_subfolder(tmpdir): git("commit", "-m", "created") git("status") - assert "nb with spaces.py" in git("ls-tree", "-r", "master", "--name-only") + assert "nb with spaces.py" in git("ls-tree", "-r", "main", "--name-only") assert os.path.isfile(tmp_py) @@ -207,8 +207,8 @@ def test_pre_commit_hook_py_to_ipynb_and_md(tmpdir): git("commit", "-m", "created") git("status") - assert "nb with spaces.ipynb" in git("ls-tree", "-r", "master", "--name-only") - assert "nb with spaces.md" in git("ls-tree", "-r", "master", "--name-only") + assert "nb with spaces.ipynb" in git("ls-tree", "-r", "main", "--name-only") + assert "nb with spaces.md" in git("ls-tree", "-r", "main", "--name-only") assert os.path.isfile(tmp_ipynb) assert os.path.isfile(tmp_md) @@ -283,7 +283,7 @@ def hook(): git("commit", "-m", "created") git("status") - assert "notebook.py" in git("ls-tree", "-r", "master", "--name-only") + assert "notebook.py" in git("ls-tree", "-r", "main", "--name-only") assert os.path.isfile(tmp_py)