Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issues with using xmlrunner, AttributeError: 'XMLTestProgram' object has no attribute 'warnings' #190

Closed
srisuman opened this issue Mar 21, 2019 · 7 comments

Comments

@srisuman
Copy link

We are using the following command to run some tests.

python -m xmlrunner discover -p "testBVT_*"

This results in the following error
Traceback (most recent call last):
File "/usr/lib64/python2.7/runpy.py", line 174, in _run_module_as_main
"main", fname, loader, pkg_name)
File "/usr/lib64/python2.7/runpy.py", line 72, in _run_code
exec code in run_globals
File "/usr/lib/python2.7/site-packages/xmlrunner/main.py", line 19, in
XMLTestProgram(module=None)
File "/usr/lib/python2.7/site-packages/xmlrunner/runner.py", line 124, in init
super(XMLTestProgram, self).init(*args, **kwargs)
File "/usr/lib64/python2.7/unittest/main.py", line 95, in init
self.runTests()
File "/usr/lib/python2.7/site-packages/xmlrunner/runner.py", line 142, in runTests
warnings=self.warnings,
AttributeError: 'XMLTestProgram' object has no attribute 'warnings'

Could you please look into the issue.

@arunrag
Copy link

arunrag commented Mar 21, 2019

Please note that this has been working on our setup till 15th March (last time we ran the test suite). Yesterday (20th March) started getting the error.

@dinio31
Copy link

dinio31 commented Mar 21, 2019

The same here with latest version (2.4.0) under python2.7 on Windows. Needed to revert to 2.3.2

>pip uninstall unittest-xml-reporting
>pip install unittest-xml-reporting==2.3.2

@arunrag
Copy link

arunrag commented Mar 22, 2019

Thank you for the suggestion. We were on Fedora Linux when we encountered the issue. Reverting to 2.3.2 helped to unblock us.

@dnozay
Copy link
Member

dnozay commented Mar 22, 2019

try master. there is a fix that hasn't been released yet

@dinio31
Copy link

dinio31 commented Mar 22, 2019

Thanks @dnozay. Tried with v2.5.0 which includes the fix you mentioned and error has moved to another place:

Traceback (most recent call last):
  File "c:\python2715\Lib\runpy.py", line 174, in _run_module_as_main
"__main__", fname, loader, pkg_name)
  File "c:\python2715\Lib\runpy.py", line 72, in _run_code
exec code in run_globals
  File "C:\xxxxxx\lib\site-packages\xmlrunner\__main__.py", line 19, in <module>
XMLTestProgram(module=None)
  File "C:\xxxxxx\lib\site-packages\xmlrunner\runner.py", line 125, in __init__
super(XMLTestProgram, self).__init__(*args, **kwargs)
  File "c:\python2715\Lib\unittest\main.py", line 95, in __init__
self.runTests()
  File "C:\xxxxxx\lib\site-packages\xmlrunner\runner.py", line 177, in runTests
self.testRunner = self.testRunner(**kwargs)
  File "C:\xxxxxx\lib\site-packages\xmlrunner\runner.py", line 22, in __init__
super(XMLTestRunner, self).__init__(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'warnings'

@srisuman
Copy link
Author

@dnozay I tried the master as well and ran into the same issue.

dnozay added a commit that referenced this issue Mar 25, 2019
dnozay added a commit that referenced this issue Mar 25, 2019
@dnozay
Copy link
Member

dnozay commented Mar 26, 2019

fixed in 2.5.1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants