Skip to content

Commit

Permalink
Merge pull request #14 from michel-slm/prefer-unittest-mock
Browse files Browse the repository at this point in the history
  • Loading branch information
wkeeling authored Feb 22, 2024
2 parents 9086cd5 + 4f56ff9 commit 852aa57
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 3 deletions.
9 changes: 8 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
from setuptools import setup
from sys import version_info

if version_info.major < 3 or \
(version_info.major == 3 and version_info.minor < 4):
tests_require=['mock']
else:
tests_require=[]

setup(
author='Will Keeling',
Expand Down Expand Up @@ -26,7 +33,7 @@
name='ratelimitingfilter',
packages=['ratelimitingfilter'],
test_suite='tests',
tests_require=['mock'],
tests_require=tests_require,
url='https://github.com/wkeeling/ratelimitingfilter',
version='1.5',
)
5 changes: 4 additions & 1 deletion tests/ratelimitingfilter_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import logging
import os
from unittest.case import TestCase
from mock import Mock, patch
try:
from unittest.mock import Mock, patch
except ImportError:
from mock import Mock, patch

from ratelimitingfilter import RateLimitingFilter

Expand Down
2 changes: 1 addition & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ setenv =
deps =
coverage
nose
mock
py27: mock
commands = nosetests --with-coverage --cover-erase tests

0 comments on commit 852aa57

Please sign in to comment.