def pytest_sessionstart(request):
""" before session.main() is called. """
import crypt, shutil
pw = crypt.crypt(pws[0], 'ab')
dbpath = os.path.join(SEC_DB_PATH, user)
thisdir = os.path.dirname(os.path.abspath(__file__))
if os.path.exists(dbpath):
subprocess.Popen("sudo rm -rf {}".format(dbpath), shell=True)
if DISTRO == 'darwin':
subprocess.Popen(
"sudo {2}/create_mac_user.sh {0} {1}"
.format(user, pws[0], thisdir),
shell=True
)
elif DISTRO == 'windows':
print("WINDOWS: Ignoring!!")
else:
cmd = "sudo {2}/create_linux_user.sh {0} {1}".format(user, pw, thisdir),
subprocess.Popen(
cmd,
shell=True
)
print("LINUX: {}".format(cmd))
assert check(0)
评论列表
文章目录