Skip to content

Commit

Permalink
Merge 2ec0be4 into efc850b
Browse files Browse the repository at this point in the history
  • Loading branch information
gtalarico committed Mar 6, 2020
2 parents efc850b + 2ec0be4 commit c58383a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 8 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

setup_requires = ["pytest-runner"]
install_requires = ["requests>=2", "six>=1.10"]
tests_require = ["requests-mock", "requests"]
tests_require = ["requests-mock", "requests", "mock"]

setup(
name=about["__name__"],
Expand Down
6 changes: 5 additions & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,14 @@
from collections import OrderedDict
from posixpath import join as urljoin

from mock import Mock
from requests import HTTPError
from six.moves.urllib.parse import urlencode, quote

try:
from unittest.mock import Mock
except ImportError:
from mock import Mock

from airtable import Airtable


Expand Down
6 changes: 1 addition & 5 deletions tests/test_airtable_class.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
from posixpath import join as urljoin

import pytest
from posixpath import join as urljoin
from requests_mock import Mocker
from six.moves.urllib.parse import urlencode
from unittest.mock import call

from airtable import Airtable

Expand Down Expand Up @@ -129,8 +127,6 @@ def test_batch_insert(table, mock_records):
records = [i["fields"] for i in mock_records]
resp = table.batch_insert(records)
assert seq_equals(resp, mock_records)
calls = [(call(r, typecast=True)) for r in records]
table.insert.assert_has_calls(calls)


def test_update(table, mock_response_single):
Expand Down
6 changes: 5 additions & 1 deletion tests/test_request_errors.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
import pytest
from mock import Mock
from requests import HTTPError

try:
from unittest.mock import Mock
except ImportError:
from mock import Mock


def http_error_with_url():
raise HTTPError("unable to process page%20url")
Expand Down

0 comments on commit c58383a

Please sign in to comment.