Supports the @patch decorator with parametrized when used with async methods
Its a pretty simple fix, I also tried to add tests but failed since
Nose can't do async and I can't make it skip the test
All the python 2 runners instantly fail on SyntaxError even though I put the tests under an IF PY_3.8
If you do manage to make the tests work, this is a simple test I wrote
For what its worth, it did pass all of the tests with 3.6+ (apart from nose), and I tested it with several patches as well
if sys.version_info.major == 3 and sys.version_info.minor >= 8:
from unittest import IsolatedAsyncioTestCase
class TestAsyncParameterizedExpandWithNoMockPatchForClass(IsolatedAsyncioTestCase):
expect([
"test_one_async_function_patch_decorator('foo1', 'umask')",
"test_one_async_function_patch_decorator('foo0', 'umask')",
"test_one_async_function_patch_decorator(42, 'umask')",
])
@parameterized.expand([(42,), "foo0", param("foo1")])
@mock.patch("os.umask")
async def test_one_async_function_patch_decorator(self, foo, mock_umask):
missing_tests.remove("test_one_async_function_patch_decorator(%r, %r)" %
(foo, mock_umask._mock_name))
P.s you really should add some contributing guide explaining how to set the project up, and how to test it :)
Supports the
@patch
decorator with parametrized when used with async methods Its a pretty simple fix, I also tried to add tests but failed sinceIf you do manage to make the tests work, this is a simple test I wrote For what its worth, it did pass all of the tests with 3.6+ (apart from nose), and I tested it with several patches as well
P.s you really should add some contributing guide explaining how to set the project up, and how to test it :)