mirror of
https://github.com/YunoHost/yunohost.git
synced 2024-09-03 20:06:10 +02:00
ci: when running pytest, make sure that 'import yunohost' will load the code being tested, not the one from /usr/lib/python3/dist-packages ?
This commit is contained in:
parent
fd040b864e
commit
0bbc14f54b
1 changed files with 5 additions and 2 deletions
|
@ -68,10 +68,13 @@ moulinette.core.Translator.translate = new_translate
|
|||
|
||||
def pytest_cmdline_main(config):
|
||||
import sys
|
||||
from pathlib import Path
|
||||
|
||||
# Tweak python path such that "import yunohost" imports "this" code and not the one from /usr/lib/python3/dist-packages
|
||||
code_root = str(Path(__file__).parent.parent.parent)
|
||||
sys.path.insert(0, code_root)
|
||||
|
||||
sys.path.insert(0, "/usr/lib/moulinette/")
|
||||
import yunohost
|
||||
|
||||
yunohost.init()
|
||||
|
||||
class DummyInterface:
|
||||
|
|
Loading…
Add table
Reference in a new issue