Under Windows 7 and Windows 10 operating system, I always quote this error
Ask how to solve this problem, thank you!
Script code is as follows:
The import unittest
The import sys
The import time
The import of logging
The from BSTestRunner import BSTestRunner
Project_path="D: \ \ Project \ \ appium_test_framework \ "
Sys. Path. Append (project_path)
Case_dir='../test_case '
Report_dir='../test_report '
Discover=unittest. DefaultTestLoader. Discover (case_dir, pattern='login_case. Py')
Y - now=time. Strftime (' % % m M_ H_ - % d % % % S ')
Report_name=report_dir + + now, '/' 'login_test_report. HTML'
With the open (report_name, 'wb) as f:
Test_ruuner=BSTestRunner (stream=f, title='KYB Test Report - Login', the description='Testing -based on Android system.')
Logging. The info (' Start run the login testcase... ')
Test_ruuner. Run (discover)
CodePudding user response:
A virtual environment has not started, the import is not successful?CodePudding user response:
In Linux, Windows development is wrong also nobody tubeCodePudding user response:
If it is using unittest, may be a solution: try add parameters at the command line, enter - m unittest:Python -m unittest script name. Py
I was use this way to get rid of, I hope useful
CodePudding user response:
Well, have more than two years, the problem solved? I also encountered this kind of question, but couldn't find a solution, can provide the solution