Skip to content

Commit

Permalink
Merge pull request #156 from wolever/test-for-mock-patch-multiple
Browse files Browse the repository at this point in the history
Test for mock patch multiple
  • Loading branch information
wolever authored Mar 2, 2023
2 parents 02a289c + 5872986 commit 4d5f3d6
Showing 1 changed file with 30 additions and 0 deletions.
30 changes: 30 additions & 0 deletions parameterized/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,6 +285,36 @@ def test_mock_patch_standalone_function(foo, mock_umask):
)


class TestParameterizedExpandWithMockPatchMultiple(TestCase):
expect([
"test_mock_patch_multiple_expand(42, 'umask', 'getpid')",
])

@parameterized.expand([(42, )])
@mock.patch.multiple("os", umask=mock.DEFAULT, getpid=mock.DEFAULT)
def test_mock_patch_multiple_expand(self, param, umask, getpid):
missing_tests.remove(
"test_mock_patch_multiple_expand(%r, %r, %r)" %(
param, umask._mock_name, getpid._mock_name
)
)


expect("standalone", [
"test_mock_patch_multiple_standalone(42, 'umask', 'getpid')",
])

@parameterized([(42, )])
@mock.patch.multiple("os", umask=mock.DEFAULT, getpid=mock.DEFAULT)
def test_mock_patch_multiple_standalone(param, umask, getpid):
missing_tests.remove(
"test_mock_patch_multiple_standalone(%r, %r, %r)" %(
param, umask._mock_name, getpid._mock_name
)
)



class TestParamerizedOnTestCase(TestCase):
expect([
"test_on_TestCase('foo0', bar=None)",
Expand Down

0 comments on commit 4d5f3d6

Please sign in to comment.