← Back
Editing: test_pylabtools.cpython-311.pyc
� �@�c� � � � d Z ddlmZ ddlmZ ddlZ ej d� � Ze� d� � ddl m Z ddlmZ dd l mZ ddlZdd lmZ ddlmZ ddlmZmZ d dlmZ ddlmZ d� Zd� Z ej d� � d� � � Z!d� Z"dddddd�Z#d� Z$d� Z%d� Z&d� Z'd� Z(ddl)m*Z* G d � d!e+� � Z,d"� Z-d#� Z.dS )$zTests for pylab tools module. � )� a2b_base64)�BytesION� matplotlib�Agg)�Figure)�pyplot)�backend_inline)�get_ipython)�InteractiveShell)�_PNG�_JPEG� )� pylabtools)� decoratorsc � � t j � � } t j | d� � �J �t j d� � t j � � } | � ddd� � }|� g d�� � t j � � t j | d� � d d� � � � }d|v sJ �d S )N�svg�all� �r r � �d zdoctype svg) �plt�figure�pt�print_figure�close�add_subplot�plot�draw�lower)�fig�axr s �D/usr/lib/python3/dist-packages/IPython/core/tests/test_pylabtools.py�test_figure_to_svgr$ s� � � �*�,�,�C� �?�3��&�&�.�.�.��I�e���� �*�,�,�C� ����1�Q� � �B��G�G�G�G�G�����H�J�J�J� �/�#�u� %� %�d�s�d� +� 1� 1� 3� 3�C��C������� c � � ddl m} t � � }| � dd� � } |� |d� � dS # t $ r,}|j j }t j d|�d|��� � |�d}~ww xY w) z0Skip if PIL can't write JPEGs to BytesIO objectsr )�Image�RGB)� r) �jpegz!PIL can't write JPEG to BytesIO: z: N) �PILr'