Skip to content
This repository has been archived by the owner on Jan 13, 2024. It is now read-only.

Commit

Permalink
exception
Browse files Browse the repository at this point in the history
  • Loading branch information
sdpython committed Feb 4, 2023
1 parent cea6fe7 commit 50c8a05
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions _unittests/ut_velib/test_data_velib.py
Expand Up @@ -41,7 +41,7 @@ def test_datetime(self):
if d != datetime.datetime(2013, 5, 9, 19, 51, 0):
# issue with time (not the same local)
if d.year != 2013 and d.month != 5 and d.day != 9:
raise Exception("difference: " + str(d))
raise AssertionError("difference: " + str(d))

def test_data_velib_json(self):
fLOG(
Expand Down Expand Up @@ -106,7 +106,7 @@ def test_data_velib_json_collect(self):
with open(temp_file, "r", encoding="utf8") as f:
lines = f.readlines()
if len(lines) < 1:
raise Exception(
raise AssertionError(
"len(lines)<1: %d\n%s" %
(len(lines), "\n".join(lines)))
self.assertLesser(len(lines), 10)
Expand All @@ -117,7 +117,7 @@ def test_data_velib_json_collect(self):
single_file=False, log_every=1, fLOG=fLOG)
res = os.listdir(tempfold)
if len(res) <= 2:
raise Exception(str(res))
raise AssertionError(str(res))

def test_data_velib_json_collect_func(self):
fLOG(
Expand Down Expand Up @@ -146,7 +146,7 @@ def test_data_velib_json_collect_func(self):
with open(temp_file, "r", encoding="utf8") as f:
lines = f.readlines()
if len(lines) < 1:
raise Exception(
raise AssertionError(
"len(lines)<1: %d\n%s" %
(len(lines), "\n".join(lines)))
self.assertLesser(len(lines), 10)
Expand Down Expand Up @@ -178,7 +178,7 @@ def test_data_velib_json_collect_func_besancon(self):
with open(temp_file, "r", encoding="utf8") as f:
lines = f.readlines()
if len(lines) < 1:
raise Exception(
raise AssertionError(
"len(lines)<1: %d\n%s" %
(len(lines), "\n".join(lines)))
self.assertLesser(len(lines), 10)
Expand Down
4 changes: 2 additions & 2 deletions src/manydataapi/linkedin/linkedin_access.py
Expand Up @@ -220,7 +220,7 @@ def search_profile(self, params, selectors=None, count=10,
import pandas
return pandas.DataFrame(values)
else:
raise Exception(
raise RuntimeError(
"expecting a result such as {'people': ...}")
else:
return res
Expand All @@ -246,7 +246,7 @@ def search_profile(self, params, selectors=None, count=10,
total += fetched
alls = first.get("_total", 0)
else:
raise Exception(
raise RuntimeError(
"expecting a result such as {'people': ...} +\n" +
str(se))

Expand Down

0 comments on commit 50c8a05

Please sign in to comment.