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

Update pre-commit #1216

Merged
merged 2 commits into from
Feb 7, 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
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: 22.3.0 # Replace by any tag/version: https://github.com/psf/black/tags
rev: 23.1.0 # Replace by any tag/version: https://github.com/psf/black/tags
hooks:
- id: black
language_version: python3 # Should be a command that runs python3.6+
2 changes: 0 additions & 2 deletions jupyterlab_git/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import subprocess
import traceback
from typing import Dict, List, Optional
from unittest.mock import NonCallableMock
from urllib.parse import unquote

import nbformat
Expand Down Expand Up @@ -1739,7 +1738,6 @@ def ensure_git_credential_cache_daemon(
return

if self._GIT_CREDENTIAL_CACHE_DAEMON_PROCESS is None or force:

if force and self._GIT_CREDENTIAL_CACHE_DAEMON_PROCESS:
self._GIT_CREDENTIAL_CACHE_DAEMON_PROCESS.terminate()

Expand Down
6 changes: 2 additions & 4 deletions jupyterlab_git/tests/test_branch.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,14 +27,13 @@ def test_is_remote_branch(branch, expected):

@pytest.mark.asyncio
async def test_get_current_branch_success():

with patch("jupyterlab_git.git.execute") as mock_execute:
# Given
mock_execute.return_value = maybe_future((0, "feature-foo", ""))

# When
actual_response = await (
Git().get_current_branch(path=str(Path("/bin/test_curr_path")))
actual_response = await Git().get_current_branch(
path=str(Path("/bin/test_curr_path"))
)

# Then
Expand Down Expand Up @@ -269,7 +268,6 @@ async def test_checkout_branch_remoteref_failure():

@pytest.mark.asyncio
async def test_get_branch_reference_success():

with patch("jupyterlab_git.git.execute") as mock_execute:
# Given
actual_response = 0
Expand Down
1 change: 0 additions & 1 deletion jupyterlab_git/tests/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ async def test_changed_files_invalid_input():

@pytest.mark.asyncio
async def test_changed_files_single_commit():

with patch("jupyterlab_git.git.execute") as mock_execute:
# Given
mock_execute.return_value = maybe_future((0, "file1.ipynb\x00file2.py\x00", ""))
Expand Down
5 changes: 0 additions & 5 deletions jupyterlab_git/tests/test_pushpull.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,6 @@ async def test_git_pull_with_auth_fail():

@pytest.mark.asyncio
async def test_git_pull_success():

with patch("os.environ", {"TEST": "test"}):
with patch("jupyterlab_git.git.execute") as mock_execute:
# Given
Expand All @@ -116,7 +115,6 @@ async def test_git_pull_success():

@pytest.mark.asyncio
async def test_git_pull_with_auth_success():

with patch("os.environ", {"TEST": "test"}):
with patch("jupyterlab_git.git.execute") as mock_execute_with_authentication:
# Given
Expand Down Expand Up @@ -287,7 +285,6 @@ async def test_git_push_fail():

@pytest.mark.asyncio
async def test_git_push_with_auth_fail():

with patch("os.environ", {"TEST": "test"}):
with patch("jupyterlab_git.git.execute") as mock_execute_with_authentication:
# Given
Expand Down Expand Up @@ -321,7 +318,6 @@ async def test_git_push_with_auth_fail():

@pytest.mark.asyncio
async def test_git_push_success():

with patch("os.environ", {"TEST": "test"}):
with patch("jupyterlab_git.git.execute") as mock_execute:
# Given
Expand All @@ -344,7 +340,6 @@ async def test_git_push_success():

@pytest.mark.asyncio
async def test_git_push_with_auth_success():

with patch("os.environ", {"TEST": "test"}):
with patch("jupyterlab_git.git.execute") as mock_execute_with_authentication:
# Given
Expand Down