def patch_postgres(): psycopg2.install_patches()
def test_install_patches_skip(factory_mock, *mocks): del psycopg2.psycopg2 psycopg2.install_patches.reset() psycopg2.install_patches() factory_mock.assert_not_called()