Skip to content

Commit

Permalink
Testing: Add timeout time to all ipdb kernel tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ccordoba12 committed Dec 27, 2018
1 parent c3ed33d commit 63f9c54
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions requirements/tests.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@ qtconsole
pytest
pytest-cov
pytest-qt
pytest-timeout
mock
flaky
12 changes: 12 additions & 0 deletions spyder_kernels/ipdb/tests/test_ipdb_kernel.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ def test_available_magics(ipdb_kernel):
assert magic in kernel.cell_magics


@pytest.mark.timeout(10)
def test_shell_magic(ipdb_kernel):
"""Test %shell magic."""
kernel = ipdb_kernel
Expand All @@ -92,6 +93,7 @@ def test_shell_magic(ipdb_kernel):

@pytest.mark.skipif(os.name == 'nt',
reason="It's failing on Windows")
@pytest.mark.timeout(10)
def test_break_magic(ipdb_kernel):
"""Test %break magic."""
kernel = ipdb_kernel
Expand All @@ -109,6 +111,7 @@ def test_break_magic(ipdb_kernel):
assert script_path in log_text


@pytest.mark.timeout(10)
def test_down_magic(ipdb_kernel):
"""Test %down magic."""
kernel = ipdb_kernel
Expand All @@ -122,6 +125,7 @@ def test_down_magic(ipdb_kernel):
assert 'Newest frame' in log_text


@pytest.mark.timeout(10)
def test_help(ipdb_kernel):
"""Check availability of help information."""
kernel = ipdb_kernel
Expand All @@ -140,6 +144,7 @@ def test_help(ipdb_kernel):
assert resp == None


@pytest.mark.timeout(10)
def test_complete(ipdb_kernel):
"""Check completion."""
kernel = ipdb_kernel
Expand Down Expand Up @@ -189,6 +194,7 @@ def test_complete(ipdb_kernel):
assert kwargs != []


@pytest.mark.timeout(10)
def test_inspect(ipdb_kernel):
"""Check inspect."""
kernel = ipdb_kernel
Expand All @@ -199,6 +205,7 @@ def test_inspect(ipdb_kernel):
kernel.do_inspect('%lsmagic ', len('%lsmagic') + 1)


@pytest.mark.timeout(10)
def test_path_complete(ipdb_kernel):
kernel = ipdb_kernel
comp = kernel.do_complete('~/.ipytho', len('~/.ipytho'))
Expand Down Expand Up @@ -228,6 +235,7 @@ def test_path_complete(ipdb_kernel):
path)


@pytest.mark.timeout(10)
def test_ls_path_complete(ipdb_kernel):
kernel = ipdb_kernel
if os.name != 'nt':
Expand All @@ -240,12 +248,14 @@ def test_ls_path_complete(ipdb_kernel):

@pytest.mark.skipif(not sys.platform.startswith('linux'),
reason="Only for linux")
@pytest.mark.timeout(10)
def test_not_get_completions_path(ipdb_kernel):
kernel = ipdb_kernel
comp = kernel.do_complete('/tm', len('/tm'))
assert len(comp['matches']) == 1


@pytest.mark.timeout(10)
def test_history(ipdb_kernel):
kernel = ipdb_kernel
if os.name != 'nt':
Expand Down Expand Up @@ -273,6 +283,7 @@ def test_history(ipdb_kernel):
assert '%cd ~'


@pytest.mark.timeout(10)
def test_sticky_magics(ipdb_kernel):
kernel = ipdb_kernel
kernel.do_execute('%%%html\nhello', None)
Expand All @@ -288,6 +299,7 @@ def test_sticky_magics(ipdb_kernel):

@pytest.mark.skipif(os.environ.get('CI', None) is None,
reason="It's not meant to be run outside of CIs")
@pytest.mark.timeout(10)
def test_shell_partial_quote(ipdb_kernel):
kernel = ipdb_kernel
if os.name != 'nt':
Expand Down

0 comments on commit 63f9c54

Please sign in to comment.