summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--setup.py2
-rw-r--r--tests/test_bcrypt.py11
-rw-r--r--tox.ini1
3 files changed, 3 insertions, 11 deletions
diff --git a/setup.py b/setup.py
index 15cdf02..370a753 100644
--- a/setup.py
+++ b/setup.py
@@ -225,12 +225,10 @@ setup(
extras_require={
"tests": [
"pytest",
- "mock",
],
},
tests_require=[
"pytest",
- "mock",
],
packages=[
diff --git a/tests/test_bcrypt.py b/tests/test_bcrypt.py
index bb32299..3dc1ca1 100644
--- a/tests/test_bcrypt.py
+++ b/tests/test_bcrypt.py
@@ -1,7 +1,5 @@
import os
-import mock
-
import pytest
import six
@@ -15,8 +13,7 @@ def test_raise_implicit_compile():
def test_gensalt_basic(monkeypatch):
- urandom = mock.Mock(return_value=b"0000000000000000")
- monkeypatch.setattr(os, "urandom", urandom)
+ monkeypatch.setattr(os, "urandom", lambda n: b"0000000000000000")
assert bcrypt.gensalt() == b"$2a$12$KB.uKB.uKB.uKB.uKB.uK."
@@ -44,15 +41,13 @@ def test_gensalt_basic(monkeypatch):
(24, b"$2a$24$KB.uKB.uKB.uKB.uKB.uK."),
])
def test_gensalt_rounds_valid(rounds, expected, monkeypatch):
- urandom = mock.Mock(return_value=b"0000000000000000")
- monkeypatch.setattr(os, "urandom", urandom)
+ monkeypatch.setattr(os, "urandom", lambda n: b"0000000000000000")
assert bcrypt.gensalt(rounds) == expected
@pytest.mark.parametrize(("rounds",), [[x] for x in range(1, 4)])
def test_gensalt_rounds_invalid(rounds, monkeypatch):
- urandom = mock.Mock(return_value=b"0000000000000000")
- monkeypatch.setattr(os, "urandom", urandom)
+ monkeypatch.setattr(os, "urandom", lambda n: b"0000000000000000")
with pytest.raises(ValueError):
bcrypt.gensalt(rounds)
diff --git a/tox.ini b/tox.ini
index 0143891..c09d679 100644
--- a/tox.ini
+++ b/tox.ini
@@ -5,7 +5,6 @@ envlist = py26,py27,pypy,py32,py33,py34,pep8,py3pep8
# If you add a new dep here you probably need to add it in setup.py as well
deps =
coverage
- mock
pytest
commands =
coverage run -m pytest --strict {posargs}