summaryrefslogtreecommitdiffstats
path: root/Lib/test/inspect_fodder2.py
Commit message (Collapse)AuthorAgeFilesLines
* Make tabnanny recognize IndentationErrors raised by tokenize.Georg Brandl2006-08-141-0/+9
| | | | | Add a test to test_inspect to make sure indented source is recognized correctly. (fixes #1224621)
* some more fixes and tests for inspect.getsource(), triggered by crashesArmin Rigo2005-09-251-0/+24
| | | | from the PyPy project as well as the SF bug #1295909.
* Patch #1159931/bug #1143895: inspect.getsource failed when functions,Johannes Gijsbers2005-03-121-0/+11
| | | | | | etc., had comments after the colon, and some other cases. This patch take a simpler approach that doesn't rely on looking for a ':'. Thanks Simon Percivall!
* Whitespace normalization.Tim Peters2005-01-071-8/+8
|
* Patch #1011890: fix inspect.getsource breaking with line-continuation &Johannes Gijsbers2004-12-121-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | more. Thanks to Simon Percivall! The patch makes changes to inspect.py in two places: * the pattern to match against functions at line 436 is modified: lambdas should be matched even if not preceded by whitespace, as long as "lambda" isn't part of another word. * the BlockFinder class is heavily modified. Changes are: - checking for "def", "class" or "lambda" names before setting self.started to True. Then checking the same line for word characters after the colon (if the colon is on that line). If so, and the line does not end with a line continuation marker, raise EndOfBlock immediately. - adding self.passline to show that the line is to be included and no more checking is necessary on that line. Since a NEWLINE token is not generated when a line continuation marker exists, this allows getsource to continue with these functions even if the following line would not be indented. Also add a bunch of 'quite-unlikely-to-occur-in-real-life-but-working-anyway' tests.
* Patch #736962: port test_inspect to unittest. As part of this, move outJohannes Gijsbers2004-12-121-0/+22
the fodder modules to separate files to get rid of the imp.load_source() trickery.