diff --git a/src/mxdev/tests/conftest.py b/src/mxdev/tests/conftest.py index 66c8ca9..a119b36 100644 --- a/src/mxdev/tests/conftest.py +++ b/src/mxdev/tests/conftest.py @@ -1,6 +1,7 @@ +from .utils import Process + import os import pytest -from .utils import Process @pytest.fixture @@ -41,15 +42,18 @@ def git_allow_file_protocol(): This is needed for the submodule to be added from a local path """ from .utils import GitRepo - + shell = Process() - file_allow = shell.check_call("git config --global --get protocol.file.allow")[0].decode("utf8").strip() + file_allow = ( + shell.check_call("git config --global --get protocol.file.allow")[0] + .decode("utf8") + .strip() + ) shell.check_call(f"git config --global protocol.file.allow always") yield file_allow shell.check_call(f"git config --global protocol.file.allow {file_allow}") - @pytest.fixture def develop(src): from mxdev.tests.utils import MockDevelop diff --git a/src/mxdev/tests/test_git_submodules.py b/src/mxdev/tests/test_git_submodules.py index 24b6856..3c25cd1 100644 --- a/src/mxdev/tests/test_git_submodules.py +++ b/src/mxdev/tests/test_git_submodules.py @@ -102,7 +102,9 @@ def test_checkout_with_two_submodules(mkgitrepo, src, git_allow_file_protocol): @pytest.mark.skipif( condition=os.name == "nt", reason="submodules seem not to work on windows" ) -def test_checkout_with_two_submodules_recursive(mkgitrepo, src, git_allow_file_protocol): +def test_checkout_with_two_submodules_recursive( + mkgitrepo, src, git_allow_file_protocol +): """ Tests the checkout of a module 'egg' with a submodule 'submodule_a' and a submodule 'submodule_b' in it. @@ -297,7 +299,9 @@ def test_checkout_with_submodules_option_never(mkgitrepo, src, git_allow_file_pr @pytest.mark.skipif( condition=os.name == "nt", reason="submodules seem not to work on windows" ) -def test_checkout_with_submodules_option_never_source_always(mkgitrepo, src, git_allow_file_protocol): +def test_checkout_with_submodules_option_never_source_always( + mkgitrepo, src, git_allow_file_protocol +): """ Tests the checkout of a module 'egg' with a submodule 'submodule_a' in it and a module 'egg2' with the same submodule, initializing only the submodule @@ -358,7 +362,9 @@ def test_checkout_with_submodules_option_never_source_always(mkgitrepo, src, git @pytest.mark.skipif( condition=os.name == "nt", reason="submodules seem not to work on windows" ) -def test_checkout_with_submodules_option_always_source_never(mkgitrepo, src, git_allow_file_protocol): +def test_checkout_with_submodules_option_always_source_never( + mkgitrepo, src, git_allow_file_protocol +): """ Tests the checkout of a module 'egg' with a submodule 'submodule_a' in it and a module 'egg2' with the same submodule, not initializing the submodule @@ -482,7 +488,9 @@ def test_update_with_submodule_checkout(mkgitrepo, src, git_allow_file_protocol) @pytest.mark.skipif( condition=os.name == "nt", reason="submodules seem not to work on windows" ) -def test_update_with_submodule_dont_update_previous_submodules(mkgitrepo, src, git_allow_file_protocol): +def test_update_with_submodule_dont_update_previous_submodules( + mkgitrepo, src, git_allow_file_protocol +): """ Tests the checkout of a module 'egg' with a submodule 'submodule_a' in it. Commits changes in the detached submodule, and checks update didn't break diff --git a/src/mxdev/tests/utils.py b/src/mxdev/tests/utils.py index 41adb48..5d34146 100644 --- a/src/mxdev/tests/utils.py +++ b/src/mxdev/tests/utils.py @@ -167,7 +167,7 @@ def add_file(self, fname, msg=None): def add_submodule(self, submodule: "GitRepo", submodule_name: str): assert isinstance(submodule, GitRepo) assert isinstance(submodule_name, str) - + self(f"git submodule add {submodule.url}") self("git add .gitmodules") self(f"git add {submodule_name}")