Skip to content

Instantly share code, notes, and snippets.

@JoshM1994
Created June 20, 2020 18:19
Show Gist options
  • Save JoshM1994/4fb066a47f62b942ad2bf1ff98605199 to your computer and use it in GitHub Desktop.
Save JoshM1994/4fb066a47f62b942ad2bf1ff98605199 to your computer and use it in GitHub Desktop.
@asynctest.mock.patch("asyncio.create_subprocess_shell")
@pytest.mark.asyncio
async def test_list_files(self, mock_subproc_popen):
mock_subproc_popen.return_value = AsyncioCreateSubprocessShellCommunicateMock(
(
b"""
a.txt
b.txt
""",
b"",
)
).mock
assert...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment