mirror of
https://github.com/ankitects/anki.git
synced 2025-09-21 07:22:23 -04:00
Remove test_run.py and changes introduced in .travis.yml
This commit is contained in:
parent
755c9487c9
commit
7327452e71
2 changed files with 0 additions and 44 deletions
|
@ -4,9 +4,7 @@ python:
|
||||||
install:
|
install:
|
||||||
- sudo apt-get update
|
- sudo apt-get update
|
||||||
- sudo apt-get install portaudio19-dev
|
- sudo apt-get install portaudio19-dev
|
||||||
- pip install PyQt5 sip
|
|
||||||
- pip install -r requirements.txt
|
- pip install -r requirements.txt
|
||||||
- bash tools/build_ui.sh
|
|
||||||
- pip install nose
|
- pip install nose
|
||||||
- pip install coveralls
|
- pip install coveralls
|
||||||
|
|
||||||
|
|
|
@ -1,42 +0,0 @@
|
||||||
# coding: utf-8
|
|
||||||
from contextlib import contextmanager
|
|
||||||
|
|
||||||
import aqt
|
|
||||||
from aqt import _run
|
|
||||||
from aqt.profiles import ProfileManager
|
|
||||||
|
|
||||||
|
|
||||||
@contextmanager
|
|
||||||
def temporaryUser(name="__Temporary Test User__"):
|
|
||||||
|
|
||||||
pm = ProfileManager(base="")
|
|
||||||
|
|
||||||
if name in pm.profiles():
|
|
||||||
raise Exception(f"Could not create a temporary user with name {name}")
|
|
||||||
|
|
||||||
pm.create(name)
|
|
||||||
pm.name = name
|
|
||||||
|
|
||||||
yield name
|
|
||||||
|
|
||||||
pm.remove(name)
|
|
||||||
|
|
||||||
def test_run():
|
|
||||||
|
|
||||||
# we need a new user for the test
|
|
||||||
with temporaryUser() as name:
|
|
||||||
app = _run(argv=["anki", "-p", name], exec=False)
|
|
||||||
assert app
|
|
||||||
|
|
||||||
aqt.mw.cleanupAndExit()
|
|
||||||
|
|
||||||
# clean up what was spoiled
|
|
||||||
aqt.mw = None
|
|
||||||
|
|
||||||
# remove hooks added during app initialization
|
|
||||||
from anki import hooks
|
|
||||||
hooks._hooks = {}
|
|
||||||
|
|
||||||
# test_nextIvl will fail on some systems if the locales are not restored
|
|
||||||
import locale
|
|
||||||
locale.setlocale(locale.LC_ALL, locale.getdefaultlocale())
|
|
Loading…
Reference in a new issue