mirror of
https://github.com/ankitects/anki.git
synced 2025-09-22 07:52:24 -04:00
don't write test data in ~
This commit is contained in:
parent
5b831dd9db
commit
5bb8d317ee
1 changed files with 4 additions and 2 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
import os
|
||||
from tests.shared import getEmptyCol
|
||||
import tempfile
|
||||
|
||||
|
||||
def test_stats():
|
||||
|
@ -26,10 +27,11 @@ def test_graphs_empty():
|
|||
|
||||
def test_graphs():
|
||||
from anki import Collection as aopen
|
||||
dir = tempfile.gettempdir()
|
||||
|
||||
d = aopen(os.path.expanduser("~/test.anki2"))
|
||||
d = aopen(os.path.join(dir, "test.anki2"))
|
||||
g = d.stats()
|
||||
rep = g.report()
|
||||
with open(os.path.expanduser("~/test.html"), "w") as f:
|
||||
with open(os.path.join(dir, "test.html"), "w") as f:
|
||||
f.write(rep)
|
||||
return
|
||||
|
|
Loading…
Reference in a new issue