Skip to content

Commit

Permalink
make format
Browse files Browse the repository at this point in the history
  • Loading branch information
zworkb committed Apr 13, 2024
1 parent ec8b22c commit 111e4f5
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 9 deletions.
12 changes: 8 additions & 4 deletions src/mxdev/tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from .utils import Process

import os
import pytest
from .utils import Process


@pytest.fixture
Expand Down Expand Up @@ -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
Expand Down
16 changes: 12 additions & 4 deletions src/mxdev/tests/test_git_submodules.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/mxdev/tests/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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}")
Expand Down

0 comments on commit 111e4f5

Please sign in to comment.