Skip to content

Commit 18ca412

Browse files
author
MD-Mushfiqur123
committed
fix: replace external mock package with unittest.mock from stdlib
1 parent ba15bf3 commit 18ca412

2 files changed

Lines changed: 3 additions & 4 deletions

File tree

pyproject.toml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@ black = "^23.0.0"
2525
fastapi = "^0.89.0"
2626
lxml = "^4.9.1"
2727
starlette = "^0.22.0"
28-
mock = "^4.0.1"
2928
hiro = "^0.5.1"
3029
requests = "^2.22.0"
3130
pytest = "~=6.2.5"

tests/__init__.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
import pytest
55
from fastapi import FastAPI
6-
from mock import mock # type: ignore
6+
from unittest.mock import Mock
77
from starlette.applications import Starlette
88
from starlette.requests import Request
99

@@ -37,7 +37,7 @@ def _factory(config={}, **limiter_args):
3737
app.add_exception_handler(RateLimitExceeded, exception_handler)
3838
app.add_middleware(middleware)
3939

40-
mock_handler = mock.Mock()
40+
mock_handler = Mock()
4141
mock_handler.level = logging.INFO
4242
limiter.logger.addHandler(mock_handler)
4343
return app, limiter
@@ -61,7 +61,7 @@ def _factory(config={}, **limiter_args):
6161
app.add_exception_handler(RateLimitExceeded, exception_handler)
6262
app.add_middleware(middleware)
6363

64-
mock_handler = mock.Mock()
64+
mock_handler = Mock()
6565
mock_handler.level = logging.INFO
6666
limiter.logger.addHandler(mock_handler)
6767
return app, limiter

0 commit comments

Comments
 (0)