Skip to content

Commit

Permalink
Use the newer unittest.mock from standard library on Python 3
Browse files Browse the repository at this point in the history
  • Loading branch information
a-detiste committed Apr 4, 2024
1 parent ff31d45 commit d513c21
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 4 deletions.
1 change: 0 additions & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,6 @@
<build_export_depend condition="$ROS_PYTHON_VERSION == 3">python3-nose</build_export_depend>

<test_depend condition="$ROS_PYTHON_VERSION == 2">python-mock</test_depend>
<test_depend condition="$ROS_PYTHON_VERSION == 3">python3-mock</test_depend>
<test_depend condition="$ROS_PYTHON_VERSION == 2">python-nose</test_depend>
<test_depend condition="$ROS_PYTHON_VERSION == 3">python3-nose</test_depend>

Expand Down
5 changes: 4 additions & 1 deletion test/unit_tests/test_environment_cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import tempfile
import unittest

from mock import Mock
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock

try:
import catkin.environment_cache
Expand Down
5 changes: 4 additions & 1 deletion test/unit_tests/test_find_in_workspace.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@
import tempfile
import unittest

from mock import Mock
try:
from unittest.mock import Mock
except ImportError:
from mock import Mock

try:
import catkin
Expand Down
5 changes: 4 additions & 1 deletion test/unit_tests/test_parse_package_xml.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
import tempfile
import unittest

from mock import Mock
try:
from mock import Mock
except ImportError:
from mock import Mock

imp.load_source('parse_package_xml',
os.path.join(os.path.dirname(__file__),
Expand Down

0 comments on commit d513c21

Please sign in to comment.