Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
dalthviz committed Feb 7, 2022
1 parent 40dff4d commit ce96368
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 10 deletions.
22 changes: 15 additions & 7 deletions spyder/plugins/ipythonconsole/tests/test_ipythonconsole.py
Original file line number Diff line number Diff line change
Expand Up @@ -1091,9 +1091,14 @@ def test_mpl_backend_change(ipyconsole, qtbot):
# Assert that there's a single inline plot in the console
assert shell._control.toHtml().count('img src') == 1


# TODO: Failing on Windows. In fact on Windows you can copy with Ctrl + C
# i.e a KeyboardInterrupt isn't triggered when doing Ctrl + C while debugging
# Check Linux, MacOS
@flaky(max_runs=10)
@pytest.mark.skipif(running_in_ci(), reason="Fails frequently in CI")
@pytest.mark.skipif(running_in_ci() or os.name=='nt',
reason="Fails frequently in CI")
@pytest.mark.skipif(os.name=='nt',
reason="Fails on Windows")
def test_ctrl_c_dbg(ipyconsole, qtbot):
"""
Test that Ctrl+C works while debugging
Expand All @@ -1109,6 +1114,8 @@ def test_ctrl_c_dbg(ipyconsole, qtbot):
shell.execute('%debug print()')

# Test Ctrl+C
qtbot.waitUntil(lambda: 'IPdb [1]: ' in control.toPlainText())
control.setFocus()
qtbot.keyClick(control, Qt.Key_C, modifier=Qt.ControlModifier)
qtbot.waitUntil(
lambda: 'For copying text while debugging, use Ctrl+Shift+C' in
Expand Down Expand Up @@ -1412,11 +1419,12 @@ def test_remove_old_std_files(ipyconsole, qtbot):

# The current kernel std files should be present
for fname in glob.glob(osp.join(tmpdir, '*')):
assert osp.basename(fname).startswith('kernel')
assert any(
[osp.basename(fname).endswith(ext)
for ext in ('.stderr', '.stdout', '.fault')]
)
if osp.basename(fname) != 'test':
assert osp.basename(fname).startswith('kernel')
assert any(
[osp.basename(fname).endswith(ext)
for ext in ('.stderr', '.stdout', '.fault')]
)


@flaky(max_runs=10)
Expand Down
4 changes: 2 additions & 2 deletions spyder/plugins/projects/tests/test_plugin.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ def __getattr__(self, attr):
projects.shortcut = None
mocker.patch.object(spyder.plugins.base.SpyderDockWidget,
'install_tab_event_filter')
qtbot.addWidget(projects.get_widget())
return projects
yield projects
projects.on_close()


@pytest.fixture
Expand Down
2 changes: 1 addition & 1 deletion spyder/plugins/projects/utils/watcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,8 +107,8 @@ class WorkspaceWatcher(QObject):
It provides methods to start and stop watching folders.
"""

observer = None
def __init__(self, parent=None):
self.observer = None
super().__init__(parent)
self.event_handler = WorkspaceEventHandler(self)

Expand Down

0 comments on commit ce96368

Please sign in to comment.