Rework fetch_bytes and _fetch_pypi_json patches to make testing easier. Various improvements to test_micropip. The main feature is a new fixture
'mock_fetch' with an add_pkg method that takes a package name, a map
from version to requirements, and a choice of platform. This should
hopefully make writing more tests a lot easier (which is good because
we could use more micropip test coverage but we are limited by the
difficulty of writing good tests).

This also adds a fixture to create distinct dummy package names and
enables @pytest.mark.asyncio to handle the async calls rather than
using `asyncio.get_event_loop.run_until_complete`.
# from: http://jakevdp.github.com/blog/2012/08/24/numba-vs-cython/
# setup: import numpy as np ; X = np.linspace(0,10,200).reshape(20,10)
# run: pairwise_loop(X)

# pythran export pairwise_loop(float [][])

import numpy as np


def pairwise_loop(X):
    M, N = X.shape
    D = np.empty((M, M))
    for i in range(M):
        for j in range(M):
            d = 0.0
            for k in range(N):
                tmp = X[i, k] - X[j, k]
                d += tmp * tmp
            D[i, j] = np.sqrt(d)
    return D

# from: http://jakevdp.github.com/blog/2012/08/24/numba-vs-cython/
# setup: import numpy as np ; X = np.linspace(0,10,200).reshape(20,10)
# run: pairwise_loop(X)

# pythran export pairwise_loop(float [][])

import numpy as np


def pairwise_loop(X):
    M, N = X.shape
    D = np.empty((M, M))
    for i in range(M):
        for j in range(M):
            d = 0.0
            for k in range(N):
                tmp = X[i, k] - X[j, k]
                d += tmp * tmp
            D[i, j] = np.sqrt(d)
    return D
