Skip to content

Commit

Permalink
Import unittest.mock preferentially over mock
Browse files Browse the repository at this point in the history
# 279
  • Loading branch information
mwouts committed Jul 9, 2019
1 parent 7206e2f commit 15605d9
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 8 deletions.
5 changes: 3 additions & 2 deletions jupytext/contentsmanager.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,11 @@
import os
from datetime import timedelta
import nbformat

try:
import mock
except ImportError:
import unittest.mock as mock
except ImportError:
import mock
from tornado.web import HTTPError
from traitlets import Unicode, Float, Bool, Enum
from traitlets.config import Configurable
Expand Down
5 changes: 3 additions & 2 deletions tests/conftest.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
import pytest

try:
import mock
except ImportError:
import unittest.mock as mock
except ImportError:
import mock


@pytest.fixture
Expand Down
5 changes: 3 additions & 2 deletions tests/test_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
import sys
import time
import stat

try:
import mock
except ImportError:
import unittest.mock as mock
except ImportError:
import mock
import pytest
import nbformat
import itertools
Expand Down
4 changes: 2 additions & 2 deletions tests/test_read_simple_markdown.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
try:
import mock
except ImportError:
import unittest.mock as mock
except ImportError:
import mock
from nbformat.v4.nbbase import new_code_cell, new_raw_cell, new_markdown_cell
from jupytext.compare import compare
import jupytext
Expand Down

0 comments on commit 15605d9

Please sign in to comment.