Skip to content

Commit c3582e8

Browse files
authored
Merge pull request #475 from fcollonval/use-unittest-not-mock
Use standard unittest and not mock
2 parents 7d99bf9 + c5f861f commit c3582e8

File tree

9 files changed

+10
-10
lines changed

9 files changed

+10
-10
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,4 +107,5 @@ node_modules/
107107
package-lock.json
108108
MANIFEST
109109
jupyterlab_git/labextension/*.tgz
110+
.pytest_cache/
110111
*.tsbuildinfo

jupyterlab_git/git.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,8 @@ class Git:
6464
A single parent class containing all of the individual git methods in it.
6565
"""
6666

67-
def __init__(self, root_dir, *args, **kwargs):
68-
super(Git, self).__init__(*args, **kwargs)
69-
self.root_dir = os.path.realpath(os.path.expanduser(root_dir))
67+
def __init__(self, root_dir):
68+
self.root_dir = os.path.expanduser(root_dir)
7069

7170
def config(self, top_repo_path, **kwargs):
7271
"""Get or set Git options.

jupyterlab_git/tests/test_branch.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# python lib
22
import pytest
33
from subprocess import PIPE
4-
from mock import patch, call, Mock
4+
from unittest.mock import patch, call, Mock
55

66
# local lib
77
from jupyterlab_git.git import Git

jupyterlab_git/tests/test_clone.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from subprocess import PIPE
22

3-
from mock import patch, call, Mock
3+
from unittest.mock import patch, call, Mock
44

55
from jupyterlab_git.git import Git, GitAuthInputWrapper
66

jupyterlab_git/tests/test_config.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import json
22
import subprocess
33

4-
from mock import patch, call, Mock
4+
from unittest.mock import patch, call, Mock
55
import pytest
66

77
from jupyterlab_git.git import Git

jupyterlab_git/tests/test_detailed_log.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# python lib
22
from subprocess import PIPE
3-
from mock import patch, call, Mock
3+
from unittest.mock import patch, call, Mock
44

55
# local lib
66
from jupyterlab_git.git import Git

jupyterlab_git/tests/test_diff.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from subprocess import PIPE, STDOUT, CalledProcessError
22

3-
from mock import Mock, call, patch
3+
from unittest.mock import Mock, call, patch
44
import pytest
55
from tornado.web import HTTPError
66

jupyterlab_git/tests/test_handlers.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import json
2-
from mock import Mock, ANY, patch
2+
from unittest.mock import Mock, ANY, patch
33

44
from jupyterlab_git.handlers import (
55
GitAllHistoryHandler,

jupyterlab_git/tests/test_pushpull.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from subprocess import PIPE
22

3-
from mock import patch, call, Mock
3+
from unittest.mock import patch, call, Mock
44

55
from jupyterlab_git.git import Git
66

0 commit comments

Comments
 (0)