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

Backport PR #23513 on branch 6.x (PR: Improve reliability of some tests and fix teardown error for another one) #23517

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions spyder/app/tests/test_mainwindow.py
Original file line number Diff line number Diff line change
Expand Up @@ -786,8 +786,10 @@ def test_runconfig_workdir(main_window, qtbot, tmpdir):

@pytest.mark.order(1)
@pytest.mark.no_new_console
@flaky(max_runs=3)
@pytest.mark.skipif(sys.platform == 'darwin', reason='Hangs sometimes on Mac')
@pytest.mark.skipif(
sys.platform.startswith("linux"),
reason='Fails sometimes on Linux'
)
def test_dedicated_consoles(main_window, qtbot):
"""Test running code in dedicated consoles."""

Expand Down Expand Up @@ -2234,6 +2236,7 @@ def test_plots_plugin(main_window, qtbot, tmpdir, mocker):
assert compare_images(ipython_figname, plots_figname, 0.1) is None


@flaky(max_runs=3)
def test_plots_scroll(main_window, qtbot):
"""Test plots plugin scrolling"""
CONF.set('plots', 'mute_inline_plotting', True)
Expand Down
8 changes: 7 additions & 1 deletion spyder/plugins/editor/widgets/main_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -2106,7 +2106,13 @@ def new(self, fname=None, editorstack=None, text=None):
# See: spyder-ide/spyder#12596
finfo = self.editorstacks[0].new(fname, enc, text, default_content,
empty=True)
self._clone_file_everywhere(finfo)

# This is necessary to avoid an error in our tests
try:
self._clone_file_everywhere(finfo)
except RuntimeError:
pass

current_es.set_current_filename(finfo.filename)

if not created_from_here:
Expand Down
Loading