diff options
author | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-02-17 15:44:40 +0100 |
---|---|---|
committer | Timotej Lazar <timotej.lazar@fri.uni-lj.si> | 2016-02-17 15:44:40 +0100 |
commit | 66ae415ba019fa4528f61a23948e56a713902295 (patch) | |
tree | 3b626d214d3d85c6341f1fa2668a153e568fd66f /prolog/problems/sorting | |
parent | 138610b0709d6e251c16b391242023eec393d775 (diff) |
Prolog: only catch timeout in test functions
Diffstat (limited to 'prolog/problems/sorting')
-rw-r--r-- | prolog/problems/sorting/is_sorted_1/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/sorting/isort_2/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/sorting/pivoting_4/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/sorting/quick_sort_2/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/sorting/sins_3/common.py | 2 | ||||
-rw-r--r-- | prolog/problems/sorting/slowest_sort_ever_2/common.py | 2 |
6 files changed, 6 insertions, 6 deletions
diff --git a/prolog/problems/sorting/is_sorted_1/common.py b/prolog/problems/sorting/is_sorted_1/common.py index 8921b54..6409f20 100644 --- a/prolog/problems/sorting/is_sorted_1/common.py +++ b/prolog/problems/sorting/is_sorted_1/common.py @@ -44,7 +44,7 @@ def test(code, aux_code): for query, answers in test_cases: if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 - except: + except socket.timeout: pass finally: if engine_id: diff --git a/prolog/problems/sorting/isort_2/common.py b/prolog/problems/sorting/isort_2/common.py index e929eb1..7b48990 100644 --- a/prolog/problems/sorting/isort_2/common.py +++ b/prolog/problems/sorting/isort_2/common.py @@ -43,7 +43,7 @@ def test(code, aux_code): for query, answers in test_cases: if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 - except: + except socket.timeout: pass finally: if engine_id: diff --git a/prolog/problems/sorting/pivoting_4/common.py b/prolog/problems/sorting/pivoting_4/common.py index e558a8a..4dbabcb 100644 --- a/prolog/problems/sorting/pivoting_4/common.py +++ b/prolog/problems/sorting/pivoting_4/common.py @@ -40,7 +40,7 @@ def test(code, aux_code): for query, answers in test_cases: if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 - except: + except socket.timeout: pass finally: if engine_id: diff --git a/prolog/problems/sorting/quick_sort_2/common.py b/prolog/problems/sorting/quick_sort_2/common.py index c287f38..25466e2 100644 --- a/prolog/problems/sorting/quick_sort_2/common.py +++ b/prolog/problems/sorting/quick_sort_2/common.py @@ -49,7 +49,7 @@ def test(code, aux_code): for query, answers in test_cases: if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 - except: + except socket.timeout: pass finally: if engine_id: diff --git a/prolog/problems/sorting/sins_3/common.py b/prolog/problems/sorting/sins_3/common.py index 0650eb6..a582dc5 100644 --- a/prolog/problems/sorting/sins_3/common.py +++ b/prolog/problems/sorting/sins_3/common.py @@ -41,7 +41,7 @@ def test(code, aux_code): for query, answers in test_cases: if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 - except: + except socket.timeout: pass finally: if engine_id: diff --git a/prolog/problems/sorting/slowest_sort_ever_2/common.py b/prolog/problems/sorting/slowest_sort_ever_2/common.py index 06df01b..304f491 100644 --- a/prolog/problems/sorting/slowest_sort_ever_2/common.py +++ b/prolog/problems/sorting/slowest_sort_ever_2/common.py @@ -50,7 +50,7 @@ def test(code, aux_code): for query, answers in test_cases: if prolog.engine.check_answers(engine_id, query=query, answers=answers, timeout=1.0): n_correct += 1 - except: + except socket.timeout: pass finally: if engine_id: |