Skip to content
This repository has been archived by the owner on Jan 30, 2023. It is now read-only.

Commit

Permalink
src/sage/repl/display/formatter.py: Replace use of SAGE_EXTCODE in do…
Browse files Browse the repository at this point in the history
…ctest by importlib.resources
  • Loading branch information
Matthias Koeppe committed Dec 6, 2021
1 parent b2cb173 commit 0f63cce
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/sage/repl/display/formatter.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,16 +140,16 @@ def format(self, obj, include=None, exclude=None):
TESTS::
sage: import os
sage: from sage.env import SAGE_EXTCODE
sage: example_png = os.path.join(SAGE_EXTCODE, 'doctest', 'rich_output', 'example.png')
sage: import importlib.resources
sage: from sage.repl.rich_output.backend_ipython import BackendIPython
sage: backend = BackendIPython()
sage: shell = get_test_shell()
sage: backend.install(shell=shell)
sage: shell.run_cell('get_ipython().display_formatter')
<sage.repl.display.formatter.SageDisplayFormatter object at 0x...>
sage: shell.run_cell('from IPython.display import Image')
sage: shell.run_cell('ipython_image = Image("{0}")'.format(example_png))
sage: with importlib.resources.path(sage.repl.rich_output, 'example.png') as example_png:
....: shell.run_cell('ipython_image = Image("{0}")'.format(example_png))
sage: shell.run_cell('ipython_image')
<IPython.core.display.Image object>
sage: shell.run_cell('get_ipython().display_formatter.format(ipython_image)')
Expand Down

0 comments on commit 0f63cce

Please sign in to comment.