Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PR: Fix issue where Spyder's inline graphics preferences were not applied #22088

Merged
merged 9 commits into from
May 31, 2024
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