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 daniel.urban
Recipients daniel.urban, techtonik
Date 2011-04-04.09:27:08
SpamBayes Score 0.0075995238
Marked as misclassified No
Message-id <1301909230.08.0.5199735245.issue11759@psf.upfronthosting.co.za>
In-reply-to
Content
What about this:

>>> class MyTestCase(TestCase):
...     def test_foo(self):
...             with self.assertRaises(SyntaxError) as cm:
...                     compile('asdf jkl', 'file.py', 'eval')
...             self.assertEqual('file.py', cm.exception.filename)

This isn't good enough?
History
Date User Action Args
2011-04-04 09:27:10daniel.urbansetrecipients: + daniel.urban, techtonik
2011-04-04 09:27:10daniel.urbansetmessageid: <1301909230.08.0.5199735245.issue11759@psf.upfronthosting.co.za>
2011-04-04 09:27:08daniel.urbanlinkissue11759 messages
2011-04-04 09:27:08daniel.urbancreate