Skip to content

Conversation

@tkanemoto
Copy link
Contributor

sys.stdout and sys.sterr may not necessarily be StringIO
yet. We should catch AttributeError when trying to call
getvalue() on them.

Fixes: #83

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 8c813e6 on tkanemoto:master into 406ccad on xmlrunner:master.

@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 0da6cc9 on tkanemoto:master into 406ccad on xmlrunner:master.

@tkanemoto tkanemoto force-pushed the master branch 2 times, most recently from 328cff8 to 8fc1b97 Compare October 20, 2015 04:41
@tkanemoto tkanemoto changed the title Fix 'getvalue' AttributeError when test fails during setup Fix 'getvalue' AttributeError when test fails during __call__ Oct 20, 2015
@landscape-bot
Copy link

Code Health
Code quality remained the same when pulling 8fc1b97 on tkanemoto:master into 406ccad on xmlrunner:master.

@tkanemoto tkanemoto force-pushed the master branch 3 times, most recently from 208b817 to fd9386f Compare October 20, 2015 05:12
@landscape-bot
Copy link

Code Health
Repository health decreased by 0.54% when pulling fd9386f on tkanemoto:master into 406ccad on xmlrunner:master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 0.53% when pulling 640f1d9 on tkanemoto:master into 406ccad on xmlrunner:master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 0.53% when pulling f19b97f on tkanemoto:master into 406ccad on xmlrunner:master.

@landscape-bot
Copy link

Code Health
Repository health decreased by 0.69% when pulling f9fc7ca on tkanemoto:master into f0910b7 on xmlrunner:master.

Takeshi Kanemoto added 2 commits November 15, 2015 14:47
In some sub classes of TestCase where __call__() method is
overridden, errors may occur that prevents the super class
__call__ being called, e.g. Django's custom TestCase subclasses
do pre-setup processing such as loading the fixture etc. which,
on encountering exceptions, will skip calling __call__ on the
super class, leaving sys.stdout and sys.stderr untouched.

In the current implementation, this causes an unhandled
AttributeError when trying to call .getvalue() on sys.stdout and
sys.stderr.

Refs: xmlrunner#83
sys.stdout and sys.sterr may not necessarily be StringIO
yet. We should catch AttributeError when trying to call
getvalue() on them.

Fixes: xmlrunner#83
@landscape-bot
Copy link

Code Health
Repository health decreased by 0.69% when pulling be41af5 on tkanemoto:master into f0910b7 on xmlrunner:master.

dnozay added a commit that referenced this pull request Nov 15, 2015
Fix 'getvalue' AttributeError when test fails during __call__
@dnozay dnozay merged commit cbf1c55 into xmlrunner:master Nov 15, 2015
@dnozay
Copy link
Member

dnozay commented Nov 15, 2015

thank you.

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

Successfully merging this pull request may close these issues.

3 participants