Skip to content

Commit

Permalink
replace old mock by unittest.mock (#807)
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste authored Apr 28, 2024
1 parent 47fbce1 commit c9e73f3
Show file tree
Hide file tree
Showing 11 changed files with 13 additions and 12 deletions.
1 change: 0 additions & 1 deletion devrequirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
mock
coverage
coveralls
cython
2 changes: 1 addition & 1 deletion plyer/tests/test_battery.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from io import BytesIO
from os.path import join
from textwrap import dedent
from mock import patch, Mock
from unittest.mock import patch, Mock

from plyer.tests.common import PlatformTest, platform_import

Expand Down
2 changes: 1 addition & 1 deletion plyer/tests/test_cpu.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
import unittest
from os import environ
from os.path import join
from mock import patch, Mock
from textwrap import dedent
from unittest.mock import patch, Mock

from plyer.tests.common import PlatformTest, platform_import, splitpath

Expand Down
5 changes: 3 additions & 2 deletions plyer/tests/test_devicename.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,11 @@
* Windows
'''

import socket
import unittest
from mock import patch
from unittest.mock import patch

from plyer.tests.common import PlatformTest, platform_import
import socket


class TestDeviceName(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion plyer/tests/test_email.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
'''

import unittest
from unittest.mock import Mock, patch

from mock import Mock, patch
from plyer.tests.common import PlatformTest, platform_import


Expand Down
2 changes: 1 addition & 1 deletion plyer/tests/test_facade.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
import sys
from types import MethodType

from mock import Mock, patch
from unittest.mock import Mock, patch

import plyer

Expand Down
2 changes: 1 addition & 1 deletion plyer/tests/test_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@

from time import sleep
from os.path import dirname, abspath, join
from unittest.mock import Mock, patch

from mock import Mock, patch
from plyer.tests.common import PlatformTest, platform_import


Expand Down
2 changes: 1 addition & 1 deletion plyer/tests/test_screenshot.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

from os import mkdir, remove
from os.path import join, expanduser, exists
from unittest.mock import patch

from mock import patch
from plyer.tests.common import PlatformTest, platform_import


Expand Down
3 changes: 2 additions & 1 deletion plyer/tests/test_uniqueid.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
'''

import unittest
from mock import patch, Mock
from unittest.mock import patch, Mock

from plyer.tests.common import PlatformTest, platform_import


Expand Down
2 changes: 1 addition & 1 deletion plyer/tests/test_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
'''

import unittest
from mock import patch
from unittest.mock import patch


class TestUtils(unittest.TestCase):
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
'ios': ['pyobjus'],
'macosx': ['pyobjus'],
'android': ['pyjnius'],
'dev': ['mock', 'flake8']
'dev': ['flake8']
}
}
)
Expand Down

0 comments on commit c9e73f3

Please sign in to comment.