Fix test failure when tests are run as root
This commit is contained in:
parent
89be6f5931
commit
e790bb9e8a
|
@ -106,7 +106,9 @@ class NilmDB(object):
|
|||
try:
|
||||
os.makedirs(self.basepath)
|
||||
except OSError as e:
|
||||
if e.errno != errno.EEXIST:
|
||||
if e.errno != errno.EEXIST: # pragma: no cover
|
||||
# (no coverage, because it's hard to trigger this case
|
||||
# if tests are run as root)
|
||||
raise IOError("can't create tree " + self.basepath)
|
||||
|
||||
# Our data goes inside it
|
||||
|
|
|
@ -28,9 +28,6 @@ class Test00Nilmdb(object): # named 00 so it runs first
|
|||
def test_NilmDB(self):
|
||||
recursive_unlink(testdb)
|
||||
|
||||
with assert_raises(IOError):
|
||||
nilmdb.server.NilmDB("/nonexistant-db/foo")
|
||||
|
||||
db = nilmdb.server.NilmDB(testdb)
|
||||
db.close()
|
||||
db = nilmdb.server.NilmDB(testdb)
|
||||
|
|
Loading…
Reference in New Issue
Block a user