Use pytest.main([‘TestcasePairValue.py’]) to execute OK in the case code, but use pytest TestcasePairValue.py under cmd to execute the error as follows
Importing the while Test Module1 ImportError ‘D: \ code \ APITEST \ TestCase \ TestcasePairValue.py’.
Hint: the make your Test modules Sure / Packages have have Valid
I checked the online information and said that there was a circular reference, but I checked the two files and did not see where there is mutual reference. Finally, I found a solution to the big problem. Record it:
Create a new conftest.py file in the executed case file directory, and write the content:
import os import sys sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..')))
Get it done! It can be executed on the console normally!
- Refresh 404 after packaging Vue project, uncaught syntax error: unexpected token ＜
- Error when manipulating files: zipfile.BadZipFile: File is not a zip file
- [Go] Solve the garbled content sent by go-smtp and the unparsed html mail sent
- When using postman assertion, the global variables set in the tests of the pit will take effect only after the interface is executed
- How to Solve RemoveError: setuptools is a dependency of conda and cannot be removed from conda
- The showdialog() method in thread/threading. Timer/task reported an error: “before ole can be called, the current thread must be set to single thread unit (STA) mode.”
- [Solved] Pip install icu failed: Command “python setup.py egg_info” failed with error code 1 in
- Failed to load file or assembly “Microsoft.Office.Interop.Excel” Solution
- How to Fix Common Arcpy Error
- target is multiclass but average=’binary’. please choose another average setting.
- Windows: Nginx configuration error GetFileAttributesEx
- [Go] Testing when solving go test: warning: no tests to run
- Maven configuration error: JAVA_HOME not found in your environment
- GO Exception Runnerw.exe: CreateProcess failed with error 21
- Pytorch failed to specify GPU resolution
- STMS communications error with system/destination rfc error when sending logon data
- On error resume next, on error goto 0, err usage
- [Solved] There are test failures. Please refer to D:\Java_study\springboot\springboot-sugon-3\target\surefire-reports for the individual test results.
- MacOS Mojave uses SMB LAN share as backup disk of timemachine time machine. Disk does not support time machine backups. (error 45)
- How to Solve mount error(6): No such device or address