tests wakatime project file
This commit is contained in:
parent
5808a1d77c
commit
6ec2bc69a1
1 changed files with 4 additions and 4 deletions
|
@ -19,7 +19,7 @@ import traceback
|
||||||
try:
|
try:
|
||||||
import sqlite3
|
import sqlite3
|
||||||
HAS_SQL = True
|
HAS_SQL = True
|
||||||
except ImportError:
|
except ImportError: # pragma: nocover
|
||||||
HAS_SQL = False
|
HAS_SQL = False
|
||||||
|
|
||||||
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'packages'))
|
sys.path.insert(0, os.path.join(os.path.dirname(os.path.abspath(__file__)), 'packages'))
|
||||||
|
@ -47,7 +47,7 @@ class SessionCache(object):
|
||||||
"""
|
"""
|
||||||
|
|
||||||
if not HAS_SQL:
|
if not HAS_SQL:
|
||||||
return
|
return # pragma: nocover
|
||||||
try:
|
try:
|
||||||
conn, c = self.connect()
|
conn, c = self.connect()
|
||||||
c.execute('DELETE FROM session')
|
c.execute('DELETE FROM session')
|
||||||
|
@ -57,7 +57,7 @@ class SessionCache(object):
|
||||||
c.execute('INSERT INTO session VALUES (:value)', values)
|
c.execute('INSERT INTO session VALUES (:value)', values)
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
except:
|
except: # pragma: nocover
|
||||||
log.error(traceback.format_exc())
|
log.error(traceback.format_exc())
|
||||||
|
|
||||||
|
|
||||||
|
@ -74,7 +74,7 @@ class SessionCache(object):
|
||||||
conn, c = self.connect()
|
conn, c = self.connect()
|
||||||
except:
|
except:
|
||||||
log.error(traceback.format_exc())
|
log.error(traceback.format_exc())
|
||||||
return requests.session()
|
return requests.session() # pragma: nocover
|
||||||
|
|
||||||
session = None
|
session = None
|
||||||
try:
|
try:
|
||||||
|
|
Loading…
Reference in a new issue