Update paths again in test files

This commit is contained in:
grecoe 2021-03-16 07:35:24 -04:00
Родитель c7bf621f29
Коммит c49854ba8f
2 изменённых файлов: 25 добавлений и 10 удалений

Просмотреть файл

@ -7,14 +7,20 @@ use it on the __init__ function as well assuming you have parameters other than
""" """
import sys import sys
import typing import typing
import os import os
cur = os.getcwd() attempts=1
path_split = os.path.split(cur) found=False
if os.path.exists(os.path.join(path_split[0], 'src')): cur_path = os.getcwd()
print("ADDING PATH")
sys.path.append(os.path.join(path_split[0], 'src')) while not found:
if os.path.exists(os.path.join(cur_path, 'src')):
sys.path.append(os.path.join(cur_path, 'src'))
found = True
cur_path = os.path.split(cur_path)[0]
if attempts >= 3:
break
attempts += 1
from paramvalidator import ParameterValidator, ParameterValidationException from paramvalidator import ParameterValidator, ParameterValidationException
from paramvalidator.exceptions import ( from paramvalidator.exceptions import (

Просмотреть файл

@ -4,11 +4,20 @@
"""This file tests ParameterValidator on standalone Python methods.""" """This file tests ParameterValidator on standalone Python methods."""
import sys import sys
import os import os
import typing
cur = os.getcwd() attempts=1
path_split = os.path.split(cur) found=False
if os.path.exists(os.path.join(path_split[0], 'src')): cur_path = os.getcwd()
sys.path.append(os.path.join(path_split[0], 'src'))
while not found:
if os.path.exists(os.path.join(cur_path, 'src')):
sys.path.append(os.path.join(cur_path, 'src'))
found = True
cur_path = os.path.split(cur_path)[0]
if attempts >= 3:
break
attempts += 1
from paramvalidator import ParameterValidator, ParameterValidationException from paramvalidator import ParameterValidator, ParameterValidationException
from paramvalidator.exceptions import ( from paramvalidator.exceptions import (