Skip to content

Commit 95c6153

Browse files
committed
Migrate from mock to unittest.mock
mock is deprecated , use unittest.mock
1 parent aded789 commit 95c6153

File tree

3 files changed

+3
-4
lines changed

3 files changed

+3
-4
lines changed

test-requirements.txt

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
pytest
2-
mock
32
decorator

tests/test_collectd_cvmfs.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import sys
22

33
import pytest
4-
from mock import MagicMock, Mock, mock_open, patch
4+
from unittest.mock import MagicMock, Mock, mock_open, patch
55

66
configure_data = [
77
(["ams.cern.ch"], ["nioerr"], True, True, 30, 200),
@@ -190,4 +190,4 @@ def test_read_mounttime_failed(collectd_cvmfs, repos, attributes, memory, mountt
190190
with patch('collectd.Values') as val_mock:
191191
probe_instance.read(probe_config)
192192
if mounttime:
193-
val_mock.return_value.dispatch.assert_any_call(type='mountok', values=[0], interval=probe_config.interval)
193+
val_mock.return_value.dispatch.assert_any_call(type='mountok', values=[0], interval=probe_config.interval)

tox.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py27,py34,py35
2+
envlist = py27,py34,py35,py313
33

44
[testenv]
55
changedir=tests

0 commit comments

Comments
 (0)