dimanche 10 juillet 2016

Mocking no ssl installed

I am trying to test the compatibility wrapper for library against the possibility that Python was compiled without SSL support.

The problem is that this is detected using the following statement.

try:
    import ssl
except ImportError:
    ssl = None

How would I go about mocking this safely when removing the ssl import, before the compatibility file is even loaded (or reloaded)? Without disrupting all the other tests.

Aucun commentaire:

Enregistrer un commentaire