Integrating SpiraTest with PyUnit

Wednesday, May 29, 2024
Avatar

Hi, I am seeing the below error when trying to execute the pyunit script. Can you help ?

  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/spiratestextension.py", line 72, in recordResults
    spiraTestExecute.recordTestRun(testCaseId, releaseId, testSetId, startDate, endDate, executionStatus, runnerName, testMethodNameString, assertCount, message, stackTrace)
  File "/Library/Frameworks/Python.framework/Versions/3.12/lib/python3.12/site-packages/spiratestexecute.py", line 69, in recordTestRun
    print ("Failed to send results to SpiraTest: ", response.status, response.reason, output)
                                                    ^^^^^^^^^^^^^^^
AttributeError: 'Response' object has no attribute 'status'

4 Replies
Wednesday, May 29, 2024
Avatar
re: Anusha.Basavaraju Wednesday, May 29, 2024

It looks like there is an issue in the reporting code when an error is logged.

I would change:

response.status

to

response.status_code

and it will then correctly display the error.

Also most customers are now using our newer PyTest integration, I believe that PyUnit has been largely depreciated by the Python community.

Wednesday, May 29, 2024
Avatar
re: inflectra.david Wednesday, May 29, 2024

Thank you for the suggestion. I followed PyTest integration  doc , pytests are runned successfully but not seeing the Test Run on Spira Test.

I created a sample TestCase as default and added that test case ID in the config file, I still do not see any test runs on Spira Test. Am I missing something?

 

Thank you.

Wednesday, May 29, 2024
Avatar
re: Anusha.Basavaraju Wednesday, May 29, 2024

Hi Anusha

I'd log a support ticket to get more personalized and private support.

That way you can submit a copy of your test code for our team to look at.

We are limited on what we can assist with in the public forums.

Regards
David

Wednesday, May 29, 2024
Avatar
re: inflectra.david Wednesday, May 29, 2024

Sure, thank you

Spira Helps You Deliver Quality Software, Faster and With Lower Risk

And if you have any questions, please email or call us at +1 (202) 558-6885

 

Statistics
  • Started: Wednesday, May 29, 2024
  • Last Reply: Wednesday, May 29, 2024
  • Replies: 4
  • Views: 117