Skip to content

Commit 5d47ff4

Browse files
committed
Increase MySQLdb.times coverage to 100%
1 parent 50c0a3b commit 5d47ff4

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

MySQLdb/times.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ def DateTime_or_None(s):
6464
ms = 0
6565
return datetime(*[ int(x) for x in d.split('-')+t.split(':')+[ms] ])
6666
except (SystemExit, KeyboardInterrupt):
67-
raise
67+
raise # pragma: no cover
6868
except:
6969
return Date_or_None(s)
7070

@@ -129,6 +129,6 @@ def mysql_timestamp_converter(s):
129129
try:
130130
return Timestamp(*parts)
131131
except (SystemExit, KeyboardInterrupt):
132-
raise
132+
raise # pragma: no cover
133133
except:
134134
return None

tests/test_MySQLdb_times.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ def test_datetime_or_none(self):
4646
assert times.DateTime_or_None('2015-12-13T01:02:03.123456789') is None
4747

4848
def test_timedelta_or_none(self):
49+
assert times.TimeDelta_or_None('-1:0:0') == timedelta(0, -3600)
4950
assert times.TimeDelta_or_None('1:0:0') == timedelta(0, 3600)
5051
assert times.TimeDelta_or_None('12:55:30') == timedelta(0, 46530)
5152
assert times.TimeDelta_or_None('12:55:30.123456') == timedelta(0, 46530, 123456)

0 commit comments

Comments
 (0)