This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author r.david.murray
Recipients p-ganssle, r.david.murray
Date 2017-12-04.16:08:15
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1512403695.75.0.213398074469.issue32213@psf.upfronthosting.co.za>
In-reply-to
Content
To be pedantic, are not macros, they are context managers :)

Your first case is not something I would have thought of coding.  In the to_raise=True case, the subTest is failing because an exception is raised inside its scope.  In the to_raise=False case, the subTest scope has already ended before the assertRaises scope completes and raises its error because no exception was raised.  That is, there is no subTest in effect to be reported when that failure occurs.

In your second case, when to_raise is False, no exception is raised, so the assertRaises correctly fails, and the subtest reports that to_raise is False.  When to_raise is true, the exception is raised, the assertRaises passes and so does the subtest.  In other words, I can't reproduce the problem you cite for the second case.  Looking at what you pasted, it looks like you confused a test_assert_outer report with a test_report_inner report.

So, as far as I can see, there's nothing broken here, everything is working according to the documentation :)
History
Date User Action Args
2017-12-04 16:08:15r.david.murraysetrecipients: + r.david.murray, p-ganssle
2017-12-04 16:08:15r.david.murraysetmessageid: <1512403695.75.0.213398074469.issue32213@psf.upfronthosting.co.za>
2017-12-04 16:08:15r.david.murraylinkissue32213 messages
2017-12-04 16:08:15r.david.murraycreate