Skip to content

Commit

Permalink
Merge pull request #22088 from mrclary/issue-22034
Browse files Browse the repository at this point in the history
PR: Fix issue where Spyder's inline graphics preferences were not applied
  • Loading branch information
ccordoba12 authored May 31, 2024
2 parents b1cbb58 + 60c9af4 commit 7997b72
Show file tree
Hide file tree
Showing 8 changed files with 253 additions and 141 deletions.
6 changes: 3 additions & 3 deletions external-deps/spyder-kernels/.gitrepo

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

140 changes: 79 additions & 61 deletions external-deps/spyder-kernels/spyder_kernels/console/kernel.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions external-deps/spyder-kernels/spyder_kernels/console/shell.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

22 changes: 0 additions & 22 deletions external-deps/spyder-kernels/spyder_kernels/console/start.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

27 changes: 22 additions & 5 deletions spyder/plugins/ipythonconsole/tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
# ---- Constants
# =============================================================================
SHELL_TIMEOUT = 40000 if os.name == 'nt' else 20000
TEMP_DIRECTORY = tempfile.gettempdir()
NEW_DIR = 'new_workingdir'
PY312_OR_GREATER = sys.version_info[:2] >= (3, 12)

Expand Down Expand Up @@ -248,8 +247,7 @@ def get_plugin(name):
timeout=SHELL_TIMEOUT)
except Exception:
# Print content of shellwidget and close window
print(console.get_current_shellwidget(
)._control.toPlainText())
print(console.get_current_shellwidget()._control.toPlainText())
client = console.get_current_client()
if client.info_page != client.blank_page:
print('info_page')
Expand All @@ -275,8 +273,7 @@ def get_plugin(name):
if request.node.rep_setup.passed:
if request.node.rep_call.failed:
# Print content of shellwidget and close window
print(console.get_current_shellwidget(
)._control.toPlainText())
print(console.get_current_shellwidget()._control.toPlainText())
client = console.get_current_client()
if client.info_page != client.blank_page:
print('info_page')
Expand Down Expand Up @@ -342,3 +339,23 @@ def threads_condition():
files = [repr(f) for f in proc.open_files()]
show_diff(init_files, files, "files")
raise


@pytest.fixture
def mpl_rc_file(tmp_path):
"""Create matplotlibrc file"""
file_contents = """
figure.dpi: 99
figure.figsize: 9, 9
figure.subplot.bottom: 0.9
font.size: 9
"""
rc_file = str(tmp_path / 'matplotlibrc')
with open(rc_file, 'w') as f:
f.write(file_contents)
os.environ['MATPLOTLIBRC'] = rc_file

yield

os.environ.pop('MATPLOTLIBRC')
os.remove(rc_file)
Loading

0 comments on commit 7997b72

Please sign in to comment.