Remove test_run.py and changes introduced in .travis.yml
This commit is contained in:
parent
755c9487c9
commit
7327452e71
@ -4,9 +4,7 @@ python:
|
||||
install:
|
||||
- sudo apt-get update
|
||||
- sudo apt-get install portaudio19-dev
|
||||
- pip install PyQt5 sip
|
||||
- pip install -r requirements.txt
|
||||
- bash tools/build_ui.sh
|
||||
- pip install nose
|
||||
- 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 New Issue
Block a user