Contributions
"ModuleNotFoundError: No module named" when I generate the xml file
Hello guys, I did a series of tests using pytest, but when it comes time to generate the tests, it returns: "E ModuleNotFoundError: No module named 'GET_HEADERS'". I am importing GET_HEADERS as if it were a library, since it is a directory that is in another project, which I put the address through the Terminal using "PYTHONPATH=". When I run test_file.py for test_file.py it works, but when it comes time to generate the xml with the command "pytest --junitxml=output/junitxml_report.xml" it gives the error shown above. Does anyone know how to solve it? Thanks in advance471Views0likes0CommentsERROR UPLOAD XML FILE - PYTEST - ZEPHYR SCALE
Hello guys, I am using pytest and have generated an xml file to import into zephyr. I tried to upload it manually and tried with the REST API, but with no success both ways. Code that made me generate the xml file (I got this code from Smartbear - Configuring pytest to output JUnit XML results file): pytest --junitxml=output/junitxml_report.xml Error manually:The uploaded file cannot be interpreted. Your content is invalid. Please try again by uploading a valid file. My code with API Rest: def test_upload(self): url = 'https://api.zephyrscale.smartbear.com/v2/automations/executions/junit?projectKey="BST"&autoCreateTestCases=true' headers = {'Authorization': 'Bearer ' + 'eyJ0e...CONTINUE'} fhir = open('junitxml_report.xml', 'rb') response = requests.post(url, headers=headers, files={"archive":(fhir)}) RESPONSE: {'errorCode': 400, 'message': 'createJUnitExecutions.projectKey: must match "([A-Z][A-Z_0-9]+)"', 'status': 'Bad Request'} What can I do? Thanks in advance.Solved761Views0likes1Comment