Skip to content

Commit 56831a9

Browse files
committed
fix test: simplify check sqlite3 module not imported if not used.
1 parent 7db1cc3 commit 56831a9

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

tests/test_dependency.py

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,8 @@ def test_sqlite_import():
4040
"""
4141
Checks that SQLite module is not imported until the SQLite class is instantiated
4242
"""
43-
filename = os.path.join(tempfile.gettempdir(), str(uuid.uuid4()))
44-
45-
assert 'sqlite3' not in sys.modules
46-
db = SqliteDB(filename, JSONCodec())
47-
db.dump()
48-
assert 'sqlite3' in sys.modules
49-
50-
os.remove(filename)
43+
from doit import dependency
44+
assert not hasattr(dependency, 'sqlite3')
5145

5246
####
5347
# dependencies are files only (not other tasks).

0 commit comments

Comments
 (0)