Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix two tests related to darwin and recent git #657

Merged
merged 1 commit into from
Dec 15, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 8 additions & 2 deletions src/e3/vcs/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,16 +147,22 @@ def git_cmd(
)
return p

def init(self, url: str | None = None, remote: str | None = "origin") -> None:
def init(
self,
url: str | None = None,
remote: str | None = "origin",
initial_branch: str = "master",
) -> None:
"""Initialize a new Git repository and configure the remote.

:param url: url of the remote repository, if None create a local git
repository
:param remote: name of the remote to create
:param initial_branch: name of the initial branch (default is master)
:raise: GitError
"""
e3.fs.mkdir(self.working_tree)
self.git_cmd(["init", "-q"])
self.git_cmd(["init", "-q", f"--initial-branch={initial_branch}"])

# Git version 1.8.3.1 might crash when calling "git stash" when
# .git/logs/refs is not created. Recent versions of git do not
Expand Down
4 changes: 2 additions & 2 deletions tests/tests_e3/os/process/main_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ def run_test():
e.restore()


@pytest.mark.skipif(sys.platform == "win32", reason="A linux test")
@pytest.mark.skipif(not sys.platform.startswith("linux"), reason="A linux test")
def test_rlimit_ctrl_c():
"""Test rlimit CTRL-C.

Expand Down Expand Up @@ -193,7 +193,7 @@ def test_rlimit_ctrl_c():
assert int(end - start) < 30, f"CTRL-C failed: take {int(end - start)} seconds"


@pytest.mark.skipif(sys.platform == "win32", reason="A linux test")
@pytest.mark.skipif(not sys.platform.startswith("linux"), reason="A linux test")
def test_rlimit_foreground_option():
"""Test rlimit --foreground.

Expand Down
Loading