Skip to content

Commit

Permalink
Python 3.6+ compat
Browse files Browse the repository at this point in the history
  • Loading branch information
cjw296 committed Jul 11, 2023
1 parent 8d36bf4 commit acd5fc5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions mock/mock.py
Original file line number Diff line number Diff line change
Expand Up @@ -3063,7 +3063,7 @@ class ThreadingMixin(Base):

DEFAULT_TIMEOUT = None

def _get_child_mock(self, /, **kw):
def _get_child_mock(self, **kw):
if "timeout" in kw:
kw["timeout"] = kw.pop("timeout")
elif isinstance(kw.get("parent"), ThreadingMixin):
Expand All @@ -3081,7 +3081,7 @@ def __init__(self, *args, timeout=_timeout_unset, **kwargs):
self.__dict__["_mock_calls_events_lock"] = threading.Lock()
self.__dict__["_mock_wait_timeout"] = timeout

def reset_mock(self, /, *args, **kwargs):
def reset_mock(self, *args, **kwargs):
"""
See :func:`.Mock.reset_mock()`
"""
Expand Down
4 changes: 2 additions & 2 deletions mock/tests/testthreadingmock.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def method_2(self):


class TestThreadingMock(unittest.TestCase):
def _call_after_delay(self, func, /, *args, **kwargs):
def _call_after_delay(self, func, *args, **kwargs):
time.sleep(kwargs.pop("delay"))
func(*args, **kwargs)

Expand All @@ -24,7 +24,7 @@ def setUp(self):
def tearDown(self):
self._executor.shutdown()

def run_async(self, func, /, *args, delay=0, **kwargs):
def run_async(self, func, *args, delay=0, **kwargs):
self._executor.submit(
self._call_after_delay, func, *args, **kwargs, delay=delay
)
Expand Down

0 comments on commit acd5fc5

Please sign in to comment.