Skip to content

Commit

Permalink
remove extra mock
Browse files Browse the repository at this point in the history
  • Loading branch information
bnavigator committed Mar 28, 2021
1 parent 65d229a commit df5196d
Show file tree
Hide file tree
Showing 23 changed files with 19 additions and 88 deletions.
1 change: 0 additions & 1 deletion binder/environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@ dependencies:
- cython
- flaky
- matplotlib
- mock
- pandas
- pillow
- pytest <6.0
Expand Down
1 change: 0 additions & 1 deletion requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ coverage
cython
flaky
matplotlib
mock
pandas
pillow
pytest <6.0
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -249,7 +249,6 @@ def run(self):
'cython',
'flaky',
'matplotlib',
'mock',
'pandas',
'pillow',
'pytest<6.0',
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"""Fixtures for the Editor plugin tests."""

import os.path as osp
try:
from unittest.mock import MagicMock, Mock
except ImportError:
from mock import MagicMock, Mock # Python 2
from unittest.mock import MagicMock, Mock

# This is needed to avoid an error because QtAwesome
# needs a QApplication to work correctly.
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/tests/test_editor_config_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,7 @@
# ----------------------------------------------------------------------------
"""Tests for plugin config dialog."""

try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Test library imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/codeeditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -1489,10 +1489,7 @@ def request_hover(self, line, col, offset, show_hint=True, clicked=True):
def handle_hover_response(self, contents):
"""Handle hover response."""
if running_under_pytest():
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# On some tests this is returning a Mock
if isinstance(contents, Mock):
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

# Stdlib imports
import os
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/tests/test_bookmarks.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
"""

# Stdlib imports
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/tests/test_breakpoints.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,10 +8,7 @@
Tests for breakpoints.
"""

try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/tests/test_codeeditor_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

# Standard library imports
import os.path as osp
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/tests/test_editor.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
import os
import os.path as osp
import sys
try:
from unittest.mock import Mock, MagicMock
except ImportError:
from mock import Mock, MagicMock # Python 2
from unittest.mock import Mock, MagicMock

# Third party imports
import pytest
Expand Down
8 changes: 2 additions & 6 deletions spyder/plugins/editor/widgets/tests/test_editorsplitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,8 @@
"""

# Standard library imports
try:
from unittest.mock import Mock
import pathlib
except ImportError:
from mock import Mock # Python 2
import pathlib2 as pathlib
from unittest.mock import Mock
import pathlib

import os
import os.path as osp
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/tests/test_save.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

# Standard library imports
import os.path as osp
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/editor/widgets/tests/test_shortcuts.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
# Standard library imports
import os
import sys
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/help/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
"""

# Standard library imports
try:
from unittest.mock import Mock, MagicMock
except ImportError:
from mock import Mock, MagicMock # Python 2
from unittest.mock import Mock, MagicMock

# Third party imports
from qtpy import PYQT_VERSION
Expand Down
4 changes: 0 additions & 4 deletions spyder/plugins/history/tests/test_history_config_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,6 @@
# ----------------------------------------------------------------------------
"""Tests for plugin config dialog."""

try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2

# Test library imports
import pytest
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,7 @@
import sys
import tempfile
from textwrap import dedent
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import IPython
Expand Down
7 changes: 0 additions & 7 deletions spyder/plugins/profiler/tests/test_profiler.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,9 @@
"""


# Standard library imports
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2

# Third party imports
from qtpy.QtGui import QIcon
import pytest
import mock

# Local imports
from spyder.plugins.profiler.widgets.main_widget import ProfilerDataTree
Expand Down
5 changes: 1 addition & 4 deletions spyder/plugins/projects/widgets/tests/test_projectdialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,7 @@

# Standard library imports
import os
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import pytest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,7 @@
# Standard library imports
import os
import sys
try:
from unittest.mock import Mock, ANY
except ImportError:
from mock import Mock, ANY # Python 2
from unittest.mock import Mock, ANY

# Third party imports
import numpy as np
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import os
import sys
from datetime import datetime
try:
from unittest.mock import Mock, ANY
except ImportError:
from mock import Mock, ANY # Python 2
from unittest.mock import Mock, ANY

# Third party imports
from pandas import (DataFrame, date_range, read_csv, concat, Index, RangeIndex,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,7 @@
# Standard library imports
import string
import sys
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
from flaky import flaky
Expand Down
5 changes: 1 addition & 4 deletions spyder/widgets/tests/test_collectioneditor.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,7 @@
import copy
import datetime
from xml.dom.minidom import parseString
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock # Python 2
from unittest.mock import Mock

# Third party imports
import numpy
Expand Down

0 comments on commit df5196d

Please sign in to comment.