internlm/SWE-Fixer-Train-110K huggingface dataset:
Repository: spyder-ide/spyder

Issue:
Debugger ignores some tuple assignments
```python
IPdb [1]: a, b = 1, 2
IPdb [2]: !a, b = 1, 2
```
Neither assign anything to `a` or `b`; further, into a debug session, the expression results local variables being printed, though I could not reproduce it minimally. Below, however, works fine:

```python
IPdb [3]: (a, b) = 1, 2
```
Stranger yet, only *after* executing `[3]`, `[1]` begins to work properly.


Discussion:
Hi @OverLordGoldDragon,

I'm unable to reproduce this error, can you please upload a gif with the behavior you are having?
I could reproduce it @steff456 (please notice again that this only happens in the debugger).

@OverLordGoldDragon, I think the problem is with the variable names you picked for your example code. If I change them like this

```python
IPdb [1]: x, y = 1, 2
```

I don't see any errors. Could you try that and let us know what happens?
@ccordoba12 Yeah that works fine, I actually initially titled the issue like "tuple assignment treated as command", so `pdb` is getting confused by `a` but then it's somehow resolved by doing `(a, b) = ` first.
Ok, then the problem lies in our logic to detect when an expression involves a Pdb command.

@impact27, how do you think we could solve this?

Resolving patch:
diff --git a/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py b/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py
--- a/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py
+++ b/external-deps/spyder-kernels/spyder_kernels/customize/spyderpdb.py
@@ -6,6 +6,7 @@
 
 """Spyder debugger."""
 
+import ast
 import bdb
 import sys
 import logging
@@ -144,7 +145,16 @@ def default(self, line):
                         cmd_in_namespace = False
                 cmd_func = getattr(self, 'do_' + cmd, None)
                 is_pdb_cmd = cmd_func is not None
-                is_assignment = arg and arg[0] == "="
+                # Look for assignment
+                is_assignment = False
+                try:
+                    for node in ast.walk(ast.parse(line)):
+                        if isinstance(node, ast.Assign):
+                            is_assignment = True
+                            break
+                except SyntaxError:
+                    pass
+
                 if is_pdb_cmd:
                     if not cmd_in_namespace and not is_assignment:
                         # This is a pdb command without the '!' prefix.


Test patch:
Repository: spyder-ide/spyder

Issue:
Add rtree to our setup.py dependencies
- Now that `rtree` has wheels for Python 2.7 - 3.9, we can add a dependency for it in our `setup.py`.
- We also need to increase the minimal required version to `>=0.9.7`.


Discussion:

Resolving patch:
diff --git a/installers/macOS/setup.py b/installers/macOS/setup.py
--- a/installers/macOS/setup.py
+++ b/installers/macOS/setup.py
@@ -163,8 +163,10 @@ def make_app_bundle(dist_dir, make_lite=False):
     EXCLUDE_EGG.extend(EXCLUDES)
     EDIT_EXT = [ext[1:] for ext in _get_extensions(EDIT_FILETYPES)]
 
-    FRAMEWORKS = ['/usr/local/lib/libspatialindex.dylib',
-                  '/usr/local/lib/libspatialindex_c.dylib']  # for rtree
+    # Get rtree dylibs
+    rtree_loc = pkg_resources.get_distribution('rtree').module_path
+    rtree_dylibs = os.scandir(os.path.join(rtree_loc, 'rtree', 'lib'))
+    FRAMEWORKS = [lib.path for lib in rtree_dylibs]
 
     OPTIONS = {
         'optimize': 0,
@@ -199,6 +201,7 @@ def make_app_bundle(dist_dir, make_lite=False):
     # Copy egg info from site-packages: fixes several pkg_resources issues
     dest_dir = os.path.join(dist_dir, MAC_APP_NAME, 'Contents', 'Resources',
                             'lib', f'python{PYVER[0]}.{PYVER[1]}')
+    pkg_resources.working_set.add_entry(SPYREPO)
     for dist in pkg_resources.working_set:
         if (dist.egg_info is None or dist.key.startswith('pyobjc')
                 or dist.key in EXCLUDE_EGG):
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -234,6 +234,7 @@ def run(self):
     'qtawesome>=1.0.2',
     'qtconsole>=5.1.0',
     'qtpy>=1.5.0',
+    'rtree>=0.9.7',
     'setuptools>=39.0.0',
     'sphinx>=0.6.6',
     'spyder-kernels>=2.0.2,<2.1.0',
diff --git a/spyder/dependencies.py b/spyder/dependencies.py
--- a/spyder/dependencies.py
+++ b/spyder/dependencies.py
@@ -62,7 +62,7 @@
 QTAWESOME_REQVER = '>=1.0.2'
 QTCONSOLE_REQVER = '>=5.1.0'
 QTPY_REQVER = '>=1.5.0'
-RTREE_REQVER = '>=0.8.3'
+RTREE_REQVER = '>=0.9.7'
 SETUPTOOLS_REQVER = '>=39.0.0'
 SPHINX_REQVER = '>=0.6.6'
 SPYDER_KERNELS_REQVER = '>=2.0.2;<2.1.0'


Test patch:
diff --git a/spyder/tests/test_dependencies_in_sync.py b/spyder/tests/test_dependencies_in_sync.py
--- a/spyder/tests/test_dependencies_in_sync.py
+++ b/spyder/tests/test_dependencies_in_sync.py
@@ -257,10 +257,6 @@ def test_dependencies_for_spyder_setup_install_requires_in_sync():
         req.pop('spyder-kernels')
         req.pop('python-language-server')
 
-    # rtree is only available through conda
-    if 'rtree' in spyder_reqs:
-        spyder_reqs.pop('rtree')
-
     if 'pyqtwebengine' in spyder_setup:
         spyder_setup.pop('pyqtwebengine')
Repository: spyder-ide/spyder

Issue:
DeprecationWarning: implicit conversion to integers in spyder/widgets/colors.py:78
When running the test suite, I received the following warning:

```python
  <<<PACKAGEDIR>>>/spyder/widgets/colors.py:78: DeprecationWarning: an integer is required (got type float).  Implicit conversion to integers using __int__ is deprecated, and may be removed in a future version of Python.
    self.lineedit.setMinimumWidth(fm.width(color.name()) * 1.2)
```

Changing this to say
```python
    self.lineedit.setMinimumWidth(int(fm.width(color.name()) * 1.2))
```
should be sufficient to fix this.


Discussion:
Please submit a PR for this. Thanks!

Resolving patch:
diff --git a/spyder/widgets/colors.py b/spyder/widgets/colors.py
--- a/spyder/widgets/colors.py
+++ b/spyder/widgets/colors.py
@@ -75,7 +75,7 @@ def __init__(self, color, parent=None):
         assert isinstance(color, QColor)
         self.lineedit = QLineEdit(color.name(), parent)
         fm = self.lineedit.fontMetrics()
-        self.lineedit.setMinimumWidth(fm.width(color.name()) * 1.2)
+        self.lineedit.setMinimumWidth(int(fm.width(color.name()) * 1.2))
         self.lineedit.textChanged.connect(self.update_color)
         self.addWidget(self.lineedit)
         self.colorbtn = ColorButton(parent)


Test patch:
Repository: spyder-ide/spyder

Issue:
Segfault when restarting the kernel while restarting
## Description

### What steps will reproduce the problem?

<!--- You can use Markdown here --->

 1- Restart the kernel
 2- Restart the kernel
 3- Crash

## Versions

* Spyder version: 4.3.0.dev0 
* Python version: 3.8.6
* Qt version: 5.12.10
* PyQt5 version: 5.12.3
* Operating System: Darwin 20.3.0

### Dependencies

```

# Mandatory:
applaunchservices >=0.1.7       :  0.2.1 (OK)
atomicwrites >=1.2.0            :  1.4.0 (OK)
chardet >=2.0.0                 :  3.0.4 (OK)
cloudpickle >=0.5.0             :  1.6.0 (OK)
diff_match_patch >=20181111     :  20200713 (OK)
intervaltree >=3.0.2            :  3.1.0 (OK)
IPython >=7.6.0                 :  7.18.1 (OK)
jedi =0.17.2                    :  0.17.2 (OK)
jsonschema >=3.2.0              :  3.2.0 (OK)
keyring >=17.0.0                :  21.4.0 (OK)
nbconvert >=4.0                 :  6.0.7 (OK)
numpydoc >=0.6.0                :  1.1.0 (OK)
parso =0.7.0                    :  0.7.0 (OK)
pexpect >=4.4.0                 :  4.8.0 (OK)
pickleshare >=0.4               :  0.7.5 (OK)
psutil >=5.3                    :  5.7.2 (OK)
pygments >=2.0                  :  2.7.1 (OK)
pylint >=1.0                    :  2.6.0 (OK)
pyls >=0.36.2;<1.0.0            :  0.36.2 (OK)
pyls_black >=0.4.6              :  0.4.6 (OK)
pyls_spyder >=0.3.0             :  0.3.0 (OK)
qdarkstyle >=2.8                :  2.8.1 (OK)
qtawesome >=0.5.7               :  1.0.1 (OK)
qtconsole >=5.0.1               :  5.1.0.dev0 (OK)
qtpy >=1.5.0                    :  1.9.0 (OK)
setuptools >=39.0.0             :  50.3.0 (OK)
sphinx >=0.6.6                  :  3.2.1 (OK)
spyder_kernels >=1.10.0;<1.11.0 :  1.11.0.dev0 (OK)
three_merge >=0.1.1             :  0.1.1 (OK)
watchdog >=0.10.3               :  0.10.3 (OK)
zmq >=17                        :  19.0.2 (OK)

# Optional:
cython >=0.21                   :  0.29.21 (OK)
matplotlib >=2.0.0              :  3.3.2 (OK)
numpy >=1.7                     :  1.19.2 (OK)
pandas >=1.1.1                  :  1.1.3 (OK)
scipy >=0.17.0                  :  1.5.2 (OK)
sympy >=0.7.3                   :  1.6.2 (OK)
```



Discussion:

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole/widgets/client.py b/spyder/plugins/ipythonconsole/widgets/client.py
--- a/spyder/plugins/ipythonconsole/widgets/client.py
+++ b/spyder/plugins/ipythonconsole/widgets/client.py
@@ -622,6 +622,11 @@ def restart_kernel(self):
                 sw.kernel_manager.autorestart = False
 
                 # Create and run restarting thread
+                if (self.restart_thread is not None
+                        and self.restart_thread.isRunning()):
+                    self.restart_thread.finished.disconnect()
+                    self.restart_thread.terminate()
+                    self.restart_thread.wait()
                 self.restart_thread = QThread()
                 self.restart_thread.run = self._restart_thread_main
                 self.restart_thread.error = None


Test patch:
Repository: spyder-ide/spyder

Issue:
Tour Icon not showing
![image](https://user-images.githubusercontent.com/16781833/112211265-f6f21d00-8c1b-11eb-96dc-ea624ee38289.png)

Tested in master and an installed version with Anaconda of Spyder 4.2.1


Discussion:

Resolving patch:
diff --git a/spyder/app/tour.py b/spyder/app/tour.py
--- a/spyder/app/tour.py
+++ b/spyder/app/tour.py
@@ -115,7 +115,7 @@ def get_tour(index):
                          environment. This tip panel supports rich text. <br>\
                          <br> it also supports image insertion to the right so\
                          far",
-             'image': 'tour-spyder-logo.png'},
+             'image': 'spyder_about'},
 
             {'title': "Widget display",
              'content': ("This show how a widget is displayed. The tip panel "
@@ -152,7 +152,7 @@ def get_tour(index):
                            "important features.<br><br>"
                            "Please use the arrow keys or click on the buttons "
                            "below to move along the tour."),
-              'image': 'tour-spyder-logo.png'},
+              'image': 'spyder_about'},
 
              {'title': _("Editor"),
               'content': _("This is where you write Python code before "
@@ -274,7 +274,7 @@ def get_tour(index):
                            'information, check out our '
                            '<a href="{}">documentation</a>.'
                            '<br><br>').format(__docs_url__),
-              'image': 'tour-spyder-logo.png'
+              'image': 'spyder_about'
               },
 
              ]
@@ -323,7 +323,7 @@ def get_tour(index):
     feat30 = [{'title': "New features in Spyder 3.0",
                'content': _("<b>Spyder</b> is an interactive development "
                             "environment based on bla"),
-               'image': 'spyder.png'},
+               'image': 'spyder_about'},
 
               {'title': _("Welcome to Spyder introduction tour"),
                'content': _("Spyder is an interactive development environment "


Test patch:
Repository: spyder-ide/spyder

Issue:
Project recent_files not respected in Spyder 5
### What steps will reproduce the problem?

<!--- You can use Markdown here --->

One issue I found is that projects opened in Spyder 5 do not respect the `recent_files` list in `.spyproject/workspace.ini`, if the project was created in Spyder 4.

It appears the reason is that Spyder 4 puts it under `[main]` while Spyder 5 looks at `[workspace]`. The listing under `[main]` is not clobbered, just ignored.

This means that recent files in projects will need to be reopened. It also means possible pollution or ambiguities of `recent_files`. Perhaps having Spyder look for it in both places, moving it to `[workspace]` if found in `[main]`?

Working with artifact from #15054.


Discussion:

Resolving patch:
diff --git a/spyder/plugins/projects/api.py b/spyder/plugins/projects/api.py
--- a/spyder/plugins/projects/api.py
+++ b/spyder/plugins/projects/api.py
@@ -84,7 +84,16 @@ def set_recent_files(self, recent_files):
 
     def get_recent_files(self):
         """Return a list of files opened by the project."""
-        recent_files = self.get_option("recent_files", default=[])
+
+        # Check if recent_files in [main] (Spyder 4)
+        recent_files = self.get_option("recent_files", 'main', [])
+        if recent_files:
+            # Move to [workspace] (Spyder 5)
+            self.config.remove_option('main', 'recent_files')
+            self.set_recent_files(recent_files)
+        else:
+            recent_files = self.get_option("recent_files", default=[])
+
         recent_files = [recent_file if os.path.isabs(recent_file)
                         else os.path.join(self.root_path, recent_file)
                         for recent_file in recent_files]


Test patch:
Repository: spyder-ide/spyder

Issue:
spyder-kernels problem with Spyder 5
on MACOS (macos big sur 11.2.3) previous versions worked smoothly but after updating to spyder 5.0.0  spyder‑kernels not working and cannot be installed using ( conda install spyder‑kernels OR pip install spyder‑kernels )

#ERROR Message :
You have missing dependencies!

Mandatory:
spyder_kernels >=2.0.1,<2.1.0 : 2.0.1 (NOK)

Please install them to avoid this message.

Note: Spyder could work without some of these dependencies, however to have a smooth experience when using Spyder we strongly recommend you to install all the listed missing dependencies.

Failing to install these dependencies might result in bugs. Please be sure that any found bugs are not the direct result of missing dependencies, prior to reporting a new issue.


Discussion:

Resolving patch:
diff --git a/setup.py b/setup.py
--- a/setup.py
+++ b/setup.py
@@ -222,11 +222,11 @@ def run(self):
     'psutil>=5.3',
     'pygments>=2.0',
     'pylint>=1.0',
+    'pyls-black>=0.4.6',
+    'pyls-spyder>=0.3.2',
     'pyqt5<5.13',
     'pyqtwebengine<5.13',
     'python-language-server[all]>=0.36.2,<1.0.0',
-    'pyls-black>=0.4.6',
-    'pyls-spyder>=0.3.2',
     'pyxdg>=0.26;platform_system=="Linux"',
     'pyzmq>=17',
     'qdarkstyle==3.0.2',
diff --git a/spyder/dependencies.py b/spyder/dependencies.py
--- a/spyder/dependencies.py
+++ b/spyder/dependencies.py
@@ -63,7 +63,7 @@
 RTREE_REQVER = '>=0.8.3'
 SETUPTOOLS_REQVER = '>=39.0.0'
 SPHINX_REQVER = '>=0.6.6'
-SPYDER_KERNELS_REQVER = '>=2.0.1,<2.1.0'
+SPYDER_KERNELS_REQVER = '>=2.0.1;<2.1.0'
 TEXTDISTANCE_REQVER = '>=4.2.0'
 THREE_MERGE_REQVER = '>=0.1.1'
 # None for pynsist install for now


Test patch:
Repository: spyder-ide/spyder

Issue:
Can't click on tracebacks in the IPython console and go to the corresponding line in the editor
### What steps will reproduce the problem?

<!--- You can use Markdown here --->

When click line_10 in ipython console.
I can't go to line_10 of file by click it. ( can't it in spyder 5 / can it in spyder 4 )

![image](https://user-images.githubusercontent.com/41870428/113882015-3cd2e780-97bd-11eb-8887-82aeb914feef.png)

Versions
Spyder version: 5.0.0
Python version: 3.8.6
Qt version: 5.12.10
PyQt5 version: 5.12.3
Operating System: Windows 10




Discussion:
Hi @Smsmadly I was able to reproduce this. We will check it for a future release, thanks for the feedback! 
Just in case as a workaround maybe you could use the option `Directly enter debugging when errors appear` from the `Run > Configuration per file...` dialog

Resolving patch:
diff --git a/spyder/plugins/ipythonconsole/plugin.py b/spyder/plugins/ipythonconsole/plugin.py
--- a/spyder/plugins/ipythonconsole/plugin.py
+++ b/spyder/plugins/ipythonconsole/plugin.py
@@ -1199,7 +1199,7 @@ def register_client(self, client, give_focus=True):
         shellwidget.new_client.connect(self.create_new_client)
 
         # For tracebacks
-        control.go_to_error.connect(self.go_to_error)
+        control.sig_go_to_error_requested.connect(self.go_to_error)
 
         # For help requests
         control.sig_help_requested.connect(self.sig_help_requested)
diff --git a/spyder/plugins/ipythonconsole/widgets/control.py b/spyder/plugins/ipythonconsole/widgets/control.py
--- a/spyder/plugins/ipythonconsole/widgets/control.py
+++ b/spyder/plugins/ipythonconsole/widgets/control.py
@@ -22,7 +22,7 @@ class ControlWidget(TracebackLinksMixin, GetHelpMixin,
     """
     QT_CLASS = QTextEdit
     visibility_changed = Signal(bool)
-    go_to_error = Signal(str)
+    sig_go_to_error_requested = Signal(str)
     focus_changed = Signal()
 
     sig_help_requested = Signal(dict)
diff --git a/spyder/widgets/collectionseditor.py b/spyder/widgets/collectionseditor.py
--- a/spyder/widgets/collectionseditor.py
+++ b/spyder/widgets/collectionseditor.py
@@ -1015,9 +1015,8 @@ def __prepare_plot(self):
             try:
                 if 'matplotlib' not in sys.modules:
                     import matplotlib
-                    matplotlib.use("Qt4Agg")
                 return True
-            except:
+            except Exception:
                 QMessageBox.warning(self, _("Import error"),
                                     _("Please install <b>matplotlib</b>"
                                       " or <b>guiqwt</b>."))


Test patch:
Repository: spyder-ide/spyder

Issue:
Missing actions in the Edit menu
This was the Edit menu in Spyder 4

![imagen](https://user-images.githubusercontent.com/365293/115793559-ef946f80-a391-11eb-8ff1-bb34493a62e8.png)

and this the same menu in version 5

![imagen](https://user-images.githubusercontent.com/365293/115793682-29657600-a392-11eb-9019-90b7035d4b99.png)

We need to fix this. @dalthviz, please take a look at this one.


Discussion:

Resolving patch:
diff --git a/spyder/app/mainwindow.py b/spyder/app/mainwindow.py
--- a/spyder/app/mainwindow.py
+++ b/spyder/app/mainwindow.py
@@ -1029,9 +1029,10 @@ def create_edit_action(text, tr_text, icon):
                                                    _("Select All"),
                                                    ima.icon('selectall'))
 
-        self.edit_menu_actions = [self.undo_action, self.redo_action,
-                                  None, self.cut_action, self.copy_action,
-                                  self.paste_action, self.selectall_action]
+        self.edit_menu_actions += [self.undo_action, self.redo_action,
+                                   None, self.cut_action, self.copy_action,
+                                   self.paste_action, self.selectall_action,
+                                   None] + self.editor.edit_menu_actions
         switcher_actions = [
             self.file_switcher_action,
             self.symbol_finder_action
diff --git a/spyder/plugins/editor/plugin.py b/spyder/plugins/editor/plugin.py
--- a/spyder/plugins/editor/plugin.py
+++ b/spyder/plugins/editor/plugin.py
@@ -1070,7 +1070,6 @@ def get_plugin_actions(self):
                                   self.indent_action, self.unindent_action,
                                   self.text_uppercase_action,
                                   self.text_lowercase_action]
-        self.main.edit_menu_actions += [MENU_SEPARATOR] + self.edit_menu_actions
 
         # ---- Search menu/toolbar construction ----
         self.main.search_menu_actions += [gotoline_action]


Test patch:
Repository: spyder-ide/spyder

Issue:
Figures from different Consoles are not shown



## Problem Description
If you open two consoles in Spyder 5.0.1 and plot figures in each panels. Then on switching to consoles, you only see the figures from the last consoles shown in all plots panels. This was not the case before. and it appears to be a problem in Spyder 5.0.1.


### What steps reproduce the problem?

1. Open two Consoles. Run some scripts to plot something using matplotlib in each Console.
2. Try to switching between these two Consoles. You only see the figure from the last run in the last Console.


### What is the expected output? What do you see instead?

On switching to different Consoles, one should figures, plots etc corresponding to that scripts run in that consoles.




Discussion:
@Tissot11, thanks for reporting. You're totally right and we haven't noticed it.

We'll try to fix it in our next version.

Resolving patch:
diff --git a/spyder/plugins/plots/plugin.py b/spyder/plugins/plots/plugin.py
--- a/spyder/plugins/plots/plugin.py
+++ b/spyder/plugins/plots/plugin.py
@@ -118,4 +118,4 @@ def set_shellwidget(self, shellwidget):
         shellwidget: spyder.plugins.ipyconsole.widgets.shell.ShellWidget
             The shell widget.
         """
-        self.get_widget().add_shellwidget(shellwidget)
+        self.get_widget().set_shellwidget(shellwidget)


Test patch:
Repository: spyder-ide/spyder

Issue:
Plots pane keeps coming back
### What steps will reproduce the problem?

<!--- You can use Markdown here --->

With in-line plotting checked in Spyder 5.0, plotting from editor or console still switches to the plots pane.  If the plots pane is closed, it just comes back.

Basically, I want to plot in-line and never deal with or see the Plots panel, as was possible in Spyder 4.0.


Discussion:
Hi @lukecherveny, thanks for opening this bug. This issue is a regression from Spyder 4 and we'll take a look at it for a future release of Spyder. This will be triaged as low priority for now, if you want to see this issue fixed on the next release, we encourage you to contribute to the project, if so, don't hesitate to ask any question.
I'll take a look at this one for 5.0.2 because it's a serious regression. Thanks for reporting @lukecherveny!

Resolving patch:
diff --git a/spyder/plugins/plots/plugin.py b/spyder/plugins/plots/plugin.py
--- a/spyder/plugins/plots/plugin.py
+++ b/spyder/plugins/plots/plugin.py
@@ -71,6 +71,14 @@ def unregister(self):
         ipyconsole.sig_shellwidget_id_process_finished.disconnect(
             self.remove_shellwidget_from_id)
 
+    def switch_to_plugin(self, force_focus=False):
+        # Only switch when inline plotting is muted. This avoids
+        # showing the plugin when users want to only see plots in
+        # the IPython console.
+        # Fixes spyder-ide/spyder#15467
+        if self.get_conf('mute_inline_plotting'):
+            super().switch_to_plugin(force_focus=force_focus)
+
     # --- Public API
     # ------------------------------------------------------------------------
     def current_widget(self):


Test patch:
diff --git a/spyder/app/tests/test_mainwindow.py b/spyder/app/tests/test_mainwindow.py
--- a/spyder/app/tests/test_mainwindow.py
+++ b/spyder/app/tests/test_mainwindow.py
@@ -23,6 +23,7 @@
 
 # Third party imports
 from flaky import flaky
+import ipykernel
 from IPython.core import release as ipy_release
 from jupyter_client.manager import KernelManager
 from matplotlib.testing.compare import compare_images
@@ -1867,7 +1868,10 @@ def test_plots_plugin(main_window, qtbot, tmpdir, mocker):
 
 @pytest.mark.slow
 @flaky(max_runs=3)
-@pytest.mark.skipif(PY2, reason="It times out sometimes")
+@pytest.mark.skipif(
+    (parse_version(ipy_release.version) >= parse_version('7.23.0') and
+     parse_version(ipykernel.__version__) <= parse_version('5.5.3')),
+    reason="Fails due to a bug in the %matplotlib magic")
 def test_tight_layout_option_for_inline_plot(main_window, qtbot, tmpdir):
     """
     Test that the option to set bbox_inches to 'tight' or 'None' is