summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_inspect.py
Commit message (Collapse)AuthorAgeFilesLines
...
* | inspect.getfile: Don't crash on classes without '__module__' attribute #20372Yury Selivanov2014-01-271-0/+10
| | | | | | | | | | Some classes defined in C may not have the '__module__' attribute, so we now handle this case to avoid having unexepected AttributeError.
* | Issue #20189: Four additional builtin types (PyTypeObject,Larry Hastings2014-01-241-30/+68
| | | | | | | | | | | | PyMethodDescr_Type, _PyMethodWrapper_Type, and PyWrapperDescr_Type) have been modified to provide introspection information for builtins. Also: many additional Lib, test suite, and Argument Clinic fixes.
* | Issue #20226: Major improvements to Argument Clinic.Larry Hastings2014-01-161-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * You may now specify an expression as the default value for a parameter! Example: "sys.maxsize - 1". This support is intentionally quite limited; you may only use values that can be represented as static C values. * Removed "doc_default", simplified support for "c_default" and "py_default". (I'm not sure we still even need "py_default", but I'm leaving it in for now in case a use presents itself.) * Parameter lines support a trailing '\\' as a line continuation character, allowing you to break up long lines. * The argument parsing code generated when supporting optional groups now uses PyTuple_GET_SIZE instead of PyTuple_GetSize, leading to a 850% speedup in parsing. (Just kidding, this is an unmeasurable difference.) * A bugfix for the recent regression where the generated prototype from pydoc for builtins would be littered with unreadable "=<object ...>"" default values for parameters that had no default value. * Converted some asserts into proper failure messages. * Many doc improvements and fixes.
* | Issue #20144: Argument Clinic now supports simple constants as parameterLarry Hastings2014-01-071-1/+12
| | | | | | | | | | default values. inspect.Signature correspondingly supports them in __text_signature__ fields for builtins.
* | Issue #19535: Fixed test_docxmlrpc, test_functools, test_inspect, andSerhiy Storchaka2013-12-081-1/+2
|\ \ | |/ | | | | test_statistics when python is run with -OO.
* | Fix inspect.signature tests for builtins when docstrings are compiled out.Larry Hastings2013-11-241-1/+6
| |
* | Issue #19674: inspect.signature() now produces a correct signatureLarry Hastings2013-11-231-4/+3
| | | | | | | | for some builtins.
* | Issue #19030: final pieces for proper location of various class attributes ↵Ethan Furman2013-10-211-5/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | located in the metaclass. Okay, hopefully the very last patch for this issue. :/ I realized when playing with Enum that the metaclass attributes weren't always displayed properly. New patch properly locates DynamicClassAttributes, virtual class attributes (returned by __getattr__ and friends), and metaclass class attributes (if they are also in the metaclass __dir__ method). Also had to change one line in pydoc to get this to work. Added tests in test_inspect and test_pydoc to cover these situations.
* | Close #19030: inspect.getmembers and inspect.classify_class_attrsEthan Furman2013-10-181-11/+89
| | | | | | | | | | | | | | | | | | | | Order of search is now: 1. Try getattr 2. If that throws an exception, check __dict__ directly 3. If still not found, walk the mro looking for the eldest class that has the attribute (e.g. things returned by __getattr__) 4. If none of that works (e.g. due to a buggy __dir__, __getattr__, etc. method or missing __slot__ attribute), ignore the attribute entirely.
* | Tweak skipIf messageBrett Cannon2013-10-021-1/+1
| |
* | Try to fix issue #19134 againBrett Cannon2013-10-021-5/+6
| |
* | Issue #19134: Make a test in inspect conditional on multiprocessingBrett Cannon2013-09-301-0/+3
| | | | | | | | | | | | being available. Thanks to Remi Pointel for the bug report.
* | Close #19030: improvements to inspect and Enum.Ethan Furman2013-09-251-0/+24
| | | | | | | | | | | | | | | | | | | | inspect.getmembers and inspect.classify_class_attrs now search the metaclass mro for types.DynamicClassAttributes (what use to be called enum._RouteClassAttributeToGetattr); in part this means that these two functions no longer rely solely on dir(). Besides now returning more accurate information, these improvements also allow a more helpful help() on Enum classes.
* | Close #18626: add a basic CLI for the inspect moduleNick Coghlan2013-09-221-2/+44
| |
* | Issue #18830: inspect.getclasstree() no more produces duplicated entries evenSerhiy Storchaka2013-09-051-2/+19
|\ \ | |/ | | | | when input list contains duplicates.
| * Issue #18830: inspect.getclasstree() no more produces duplicated entries evenSerhiy Storchaka2013-09-051-2/+19
| | | | | | | | when input list contains duplicates.
* | Close #13266: Add inspect.unwrapNick Coghlan2013-07-281-1/+73
| | | | | | | | Initial patch by Daniel Urban and Aaron Iles
* | #17526: merge with 3.3.Ezio Melotti2013-03-301-0/+6
|\ \ | |/
| * #17526: fix an IndexError raised while passing code without filename to ↵Ezio Melotti2013-03-301-0/+6
| | | | | | | | inspect.findsource(). Initial patch by Tyler Doyle.
* | Issue #17071: Signature.bind() now works when one of the keyword arguments ↵Antoine Pitrou2013-01-291-0/+10
|\ \ | |/ | | | | is named self.
| * Issue #17071: Signature.bind() now works when one of the keyword arguments ↵Antoine Pitrou2013-01-291-0/+10
| | | | | | | | is named ``self``.
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-4/+4
|/
* Fix test_inspect messing up with linecache.cache.Antoine Pitrou2012-07-081-3/+9
|
* Properly test the various builtins lookup cases in inspect.getclosurevarsNick Coghlan2012-06-231-0/+24
|
* Use non-deprecated speling.Antoine Pitrou2012-06-231-44/+44
|
* Close #15153: Added inspect.getgeneratorlocals to simplify whitebox testing ↵Nick Coghlan2012-06-231-0/+46
| | | | of generator state updates
* Close #13062: Add inspect.getclosurevars to simplify testing stateful closuresNick Coghlan2012-06-231-1/+100
|
* Issue #15008: Implement PEP 362 "Signature Objects".Larry Hastings2012-06-221-1/+922
| | | | Patch by Yury Selivanov.
* Prevent test_inspect from keeping alive a ton of frames and local variables ↵Antoine Pitrou2012-06-171-12/+15
| | | | | | by way of a global variable keeping a reference to a traceback. Should fix some buildbot failures.
* Merge more test vs hashing-order fixes from 3.2.Georg Brandl2012-02-201-1/+2
|\
| * Disable an inspect test: it depends on dict ordering which parameter is ↵Georg Brandl2012-02-201-1/+2
| | | | | | | | reported as duplicate.
* | Add part of test_inspect test from 2.7Antoine Pitrou2012-01-181-0/+11
|\ \ | |/
| * Add part of test_inspect test from 2.7Antoine Pitrou2012-01-181-0/+11
| |
* | MergeMichael Foord2011-12-221-0/+17
|\ \ | |/
| * Metaclasses with metaclasses with a __dict__ descriptor can no longer ↵Michael Foord2011-12-221-0/+17
| | | | | | | | | | | | trigger code execution with inspect.getattr_static. Closes issue 11829.
* | Issue #1785: Fix inspect and pydoc with misbehaving descriptors.Antoine Pitrou2011-12-211-0/+79
|\ \ | |/ | | | | Also fixes issue #13581: `help(type)` wouldn't display anything.
| * Issue #1785: Fix inspect and pydoc with misbehaving descriptors.Antoine Pitrou2011-12-211-0/+79
| | | | | | | | Also fixes issue #13581: `help(type)` wouldn't display anything.
* | Merge 3.2Michael Foord2011-12-181-0/+5
|\ \ | |/
| * Fix inspect.getattr_static to work on modules (again).Michael Foord2011-12-181-0/+5
| | | | | | | | Closes issue 11813.
* | #13012: use splitlines(keepends=True/False) instead of splitlines(0/1).Ezio Melotti2011-09-281-1/+1
|/
* allow "fake" filenames in findsource (closes #9284)Benjamin Peterson2011-06-111-0/+17
| | | | | | This allows findsource() to work in doctests. A patch from Dirkjan Ochtman.
* #11938: Fix duplicated test name in test_inspect. Patch by Andreas Stührk.Ezio Melotti2011-04-271-1/+1
|
* Correct handling of functions with only kwarg args in getcallargs (closes ↵Benjamin Peterson2011-03-281-0/+33
| | | | | | #11256) A patch from Daniel Urban.
* Closes issue 11133. Fixes two cases where inspect.getattr_static could ↵Michael Foord2011-03-151-0/+47
| | | | trigger code execution
* Issue4335: Added a test for inspect.getsourcelines with a module without EOL ↵Alexander Belopolsky2010-12-021-8/+29
| | | | at EOF.
* Reverted unintended change from r86916Alexander Belopolsky2010-12-011-7/+0
|
* Issue #4113: Added custom __repr__ method to functools.partial.Alexander Belopolsky2010-12-011-0/+7
|
* Issue 10220: switch to using string constants rather than integers for ↵Nick Coghlan2010-11-301-0/+8
| | | | inspect.getgeneratorstate() return values and make debugging friendly str() and repr() for generator states a requirement in the test suite
* Issue #10220: Add inspect.getgeneratorstate(). Initial patch by Rodolpho ↵Nick Coghlan2010-11-211-1/+46
| | | | Eckhardt
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-2/+2
|