async def debug_info(self, ctx): """Get info about libs used by leveler and environment info""" try: from dns.version import version as dns_version except ImportError: dns_version = None except Exception as e: dns_version = e.__class__.__qualname__ # tkinter already failed once due to incorrect installation (?) pil_features = [] for feature in pilfeatures.get_supported(): try: feature = (feature, pilfeatures.version(feature) or "N/A") except Exception as e: feature = (feature, type(e)) pil_features.append(feature) # noinspection PyProtectedMember await ctx.send( chat.box( tabulate( [ ("DB lock locked", self._db_lock.locked()), ( "DB lock queue", "N/A" if self._db_lock._waiters is None else len( self._db_lock._waiters), ), ("pymongo version", pymongoversion), ("motor version", motorversion), ( "Mongo DB version", (await self.client.server_info()).get( "version", "?"), ), ("dnspython version", dns_version), ("PIL version", pilfeatures.version("pil")), ( "PIL features", tabulate(pil_features, tablefmt="psql"), ), ], tablefmt="psql", )))
def test_supported_modules(self): self.assertIsInstance(features.get_supported_modules(), list) self.assertIsInstance(features.get_supported_codecs(), list) self.assertIsInstance(features.get_supported_features(), list) self.assertIsInstance(features.get_supported(), list)
from PIL import features print('Pillow was built with following modules: {}'.format( repr(features.get_supported())))
def test_supported_modules(): assert isinstance(features.get_supported_modules(), list) assert isinstance(features.get_supported_codecs(), list) assert isinstance(features.get_supported_features(), list) assert isinstance(features.get_supported(), list)