dimanche 26 juin 2016

Python mock.patch package __all__

Does anyone know how do i mock a package?

What i want is to manipulate __all__.

Like this:

@patch("x.y.mypackage", "\__all__", return_value=[ClassX])
def test(self):
    ...

Aucun commentaire:

Enregistrer un commentaire