修改目录拼接
This commit is contained in:
parent
1892f72773
commit
ddd1950867
|
@ -11,19 +11,12 @@ isUseATX=True
|
|||
ATXHost = 'http://localhost:8000'
|
||||
|
||||
# 截图目录相关配置
|
||||
import os,platform
|
||||
import os
|
||||
currentPath = os.path.dirname(os.path.abspath(__file__))
|
||||
print(currentPath)
|
||||
if platform.system()=='Windows':
|
||||
logPath = currentPath + '\\log\\'
|
||||
reportPathWin = currentPath + '\\templates\\reports\\'
|
||||
unittestPathWin = currentPath + '\\test\\'
|
||||
screen_shot_path = currentPath + '\\static\\screenshot\\'
|
||||
else:
|
||||
reportPathLinux =currentPath + '/templates/reports/'
|
||||
unittestPathLinux = currentPath + '/test/'
|
||||
logPath = currentPath + '/log/'
|
||||
screen_shot_path = currentPath +'/static/screenshot/'
|
||||
logPath = os.path.join(currentPath,'log')
|
||||
reportPath = os.path.join(currentPath,'templates','reports')
|
||||
unittestPath = os.path.join(currentPath,'test')
|
||||
screen_shot_path = os.path.join(currentPath,'static','screenshot')
|
||||
|
||||
# smtp 发送邮件相关配置:
|
||||
is_email_enable = False #发送邮件开关
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import platform
|
||||
import os
|
||||
import logzero
|
||||
from app import config
|
||||
|
||||
class log :
|
||||
|
||||
def __init__(self) :
|
||||
self.logfile = config.logPath + 'core-service.log'
|
||||
self.logfile = os.path.join(config.logPath, 'core-service.log')
|
||||
logzero.logfile(self.logfile, maxBytes = 1e6, backupCount = 3)
|
||||
import logging
|
||||
formatter = logging.Formatter('%(asctime)-15s - [%(filename)s: %(lineno)s] -%(levelname)s: %(message)s');
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import platform
|
||||
import os
|
||||
import logzero
|
||||
from app import config
|
||||
|
||||
class log :
|
||||
|
||||
def __init__(self) :
|
||||
self.logfile = config.logPath + 'service.log'
|
||||
self.logfile = os.path.join(config.logPath, 'service.log')
|
||||
logzero.logfile(self.logfile, maxBytes = 1e6, backupCount = 3)
|
||||
import logging
|
||||
formatter = logging.Formatter('%(asctime)-15s - [%(filename)s: %(lineno)s] -%(levelname)s: %(message)s');
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import platform
|
||||
import os
|
||||
import logzero
|
||||
from app import config
|
||||
|
||||
class log :
|
||||
|
||||
def __init__(self) :
|
||||
self.logfile = config.logPath + 'flask.log'
|
||||
self.logfile = os.path.join(config.logPath, 'flask.log')
|
||||
logzero.logfile(self.logfile, maxBytes = 1e6, backupCount = 3)
|
||||
import logging
|
||||
formatter = logging.Formatter('%(asctime)-15s - [%(filename)s: %(lineno)s] -%(levelname)s: %(message)s');
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
import platform
|
||||
import os
|
||||
import logzero
|
||||
from app import config
|
||||
|
||||
class log :
|
||||
|
||||
def __init__(self) :
|
||||
self.logfile = config.logPath + 'sql.log'
|
||||
self.logfile = os.path.join(config.logPath, 'sql.log')
|
||||
logzero.logfile(self.logfile, maxBytes = 1e6, backupCount = 3)
|
||||
import logging
|
||||
formatter = logging.Formatter('%(asctime)-15s - [%(filename)s: %(lineno)s] -%(levelname)s: %(message)s');
|
||||
|
|
|
@ -1,14 +1,11 @@
|
|||
import platform
|
||||
import os
|
||||
import logzero
|
||||
from app import config
|
||||
|
||||
class log :
|
||||
|
||||
def __init__(self) :
|
||||
if platform.system() == 'Windows':
|
||||
self.logfile = config.logPath + '\\' + 'unittest.log'
|
||||
else:
|
||||
self.logfile = '/opt/flask/flask/log/unittest.log'
|
||||
self.logfile = os.path.join(config.logPath ,'unittest.log')
|
||||
logzero.logfile(self.logfile, maxBytes = 1e6, backupCount = 3)
|
||||
self.logger = logzero.logger
|
||||
|
||||
|
|
|
@ -9,11 +9,7 @@ def run_all():
|
|||
reportName = 'unittest_' + str(nowTime)
|
||||
reportFileName = reportName + '.html'
|
||||
test_folder = config.unittestPath
|
||||
|
||||
if platform.system() == 'Windows':
|
||||
reportNameFull = config.reportPath+'\\'+reportFileName
|
||||
else:
|
||||
reportNameFull = config.reportPath + '/' + reportFileName
|
||||
reportNameFull = os.path.join(config.reportPath , reportFileName)
|
||||
|
||||
start_time = datetime.datetime.now()
|
||||
pytest.main([test_folder,'--html=%s' %reportNameFull,'-o log_cli=true -o log_cli_level=INFO'])
|
||||
|
|
Binary file not shown.
After Width: | Height: | Size: 1011 KiB |
Loading…
Reference in New Issue