Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
test
autotest-airtest-web-spd
Commits
7fa0cf11
Commit
7fa0cf11
authored
Jul 10, 2024
by
xiao-hesheng
Browse files
新增流程十数据库验证脚本
parent
68d85bc0
Changes
1
Hide whitespace changes
Inline
Side-by-side
main1/main_text.py
View file @
7fa0cf11
import
time
import
sys
import
os
# print('根据当前文件获取当前文件所在目录的路径', os.path.dirname(__file__))
curPath
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
# 获取当前文件的所在目录的绝对路径
# print('将路径中的/换成\\', curPath) # C:\Users\Administrator\Desktop\temp\dbshop99\main
# # #将当前文件的所在目录的绝对路径进行分离,分离成 ('C:\\Users\\Administrator\\Desktop\\temp\\dbshop99', 'main'),存到元组中
# print('切割路径,切割成一个元组,将路径分离', os.path.split(curPath))
rootPath
=
os
.
path
.
split
(
curPath
)[
0
]
# [0]表示元组中的为一个元素
# print('当前项目的根目录', rootPath)
sys
.
path
.
append
(
rootPath
)
# 将项目的根目录路径添加到环境变量中,然后在cmd命令行中就可以正常运行脚本
# print('根据当前文件获取当前文件所在目录的路径', os.path.dirname(__file__))
from
airtest.core.helper
import
using
from
common.common_func
import
commonFuc
from
common.db.sql.sql_del_branch_info
import
delData
curPath
=
os
.
path
.
abspath
(
os
.
path
.
dirname
(
__file__
))
# 获取当前文件的所在目录的绝对路径
#
curPath = os.path.abspath(os.path.dirname(__file__)) # 获取当前文件的所在目录的绝对路径
# print('将路径中的/换成\\', curPath) # C:\Users\Administrator\Desktop\temp\dbshop99\main
# # #将当前文件的所在目录的绝对路径进行分离,分离成 ('C:\\Users\\Administrator\\Desktop\\temp\\dbshop99', 'main'),存到元组中
# print('切割路径,切割成一个元组,将路径分离', os.path.split(curPath))
rootPath
=
os
.
path
.
split
(
curPath
)[
0
]
# [0]表示元组中的为一个元素
#
rootPath = os.path.split(curPath)[0] # [0]表示元组中的为一个元素
# print('当前项目的根目录', rootPath)
sys
.
path
.
append
(
rootPath
)
# 将项目的根目录路径添加到环境变量中,然后在cmd命令行中就可以正常运行脚本
print
(
'rootPath'
,
rootPath
)
#
sys.path.append(rootPath) # 将项目的根目录路径添加到环境变量中,然后在cmd命令行中就可以正常运行脚本
#
print('rootPath',rootPath)
sys
.
path
.
append
(
os
.
path
.
join
(
rootPath
,
'common'
))
print
(
sys
.
path
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment