Commit Graph

123 Commits

Author SHA1 Message Date
Dave Halter ea09983566 Some small typing improvements for tests 2026-02-16 21:20:27 +01:00
Dave Halter 8cbb817b12 Fix a lot of test related typing issues 2026-02-10 19:38:55 +01:00
Peter Law 857c9be500 Ignore py__name__ issues for functools.partial in Python 3.13.0b3+
See https://github.com/davidhalter/jedi/issues/2012 for details.
2024-07-05 21:38:28 +01:00
Peter Law 340dedd021 Use an explicit mapping for locals in this test
In Python 3.13 the `locals` function now returns a fresh mapping
each time it's called (when called in a function). We thus need
to store a reference to the mapping being used, rather than
re-fetching it each time.

Since we don't actually need to modify the locals within the scope
of the test function itself, it suffices to use our own mapping
here rather than the result of calling `locals`, which fully
isolates this test from the nature of that function.

Fixes https://github.com/davidhalter/jedi/issues/2002
2024-07-02 21:37:34 +01:00
Peter Law 0fcb4468e7 Fix or ignore lints in tests 2024-06-30 19:05:38 +01:00
Dave Halter 57aefed6ea Allow unsafe custom __getitem__ executions when allow unsafe executions is on 2023-07-29 00:33:09 +02:00
Dave Halter 8a4b079d0f allow_descriptor_getattr -> allow_unsafe_interpreter_executions 2023-07-29 00:06:55 +02:00
Dave Halter 62cbcb0844 Make nested dict completions possible.
See also https://github.com/ipython/ipython/issues/13866
2023-07-28 23:50:38 +02:00
Dave Halter 886279fb6d Try to use the return annotations of properties, if available, fixes #1933 2023-07-28 22:35:15 +02:00
Dave Halter ff3a7f367f Avoid evaluating properties just for the api type, improves #1933 2023-07-28 22:11:15 +02:00
Patterson, Kevin R fac0b7f068 instance_allow_descriptor_getattr as public setting 2023-02-10 05:43:21 -06:00
Steve Kowalik 00e23ddcee Support Python 3.11 typing changes
Python 3.11 has changed typing so that unions now  return forward
refrences instead of erroring, and typing.Any is now an _AnyMeta class.
Correct the parameters for both of those.

Fixes #1858
2023-01-10 14:52:24 +11:00
Dave Halter 3a30008cc4 Fix keyword argument completion, fixes #1856 2022-11-13 20:26:00 +01:00
Dave Halter a17b958078 Fix infer_default for params in REPL, fixes #1738 2021-11-16 23:36:22 +01:00
Lumír 'Frenzy' Balhar eab1b8be8b inspect now raises OSError for objects without source file
CPython issue: https://bugs.python.org/issue44648
2021-09-01 20:50:54 +02:00
Dave Halter 387d73990b Fix issues with getitem on compiled objects that have annotations, see #1719 2021-01-17 13:48:22 +01:00
Dave Halter 1ccc63e83d Make py__iter__ work as well for Interpreter 2021-01-01 17:58:31 +01:00
Dave Halter 971913be35 Make it possible to use __getitem__ in interpreter 2021-01-01 15:57:55 +01:00
Dave Halter c1f4e7d874 One interpreter test is different for 3.9+ 2020-09-19 21:27:55 +02:00
Dave Halter f18493b627 Fix an interpreter test 2020-09-19 20:57:32 +02:00
Dave Halter 1ece7698c2 Merge branch 'master' into python3 2020-07-17 16:07:54 +02:00
Dave Halter 7851dff915 Properly negate with Interpreter, fixes #1636 2020-07-17 15:57:32 +02:00
Dave Halter 9957374508 Fix dict completions for inherited dicts, fixes #1631 2020-07-14 17:50:12 +02:00
Dave Halter 3ffe8475b8 Make sure the interpreter completions work better in Jupyter Notebook, fixes #1628 2020-07-12 22:20:06 +02:00
Dave Halter 396d7df314 Fix an issue with interpreter completion, see also #1628 2020-07-12 22:02:00 +02:00
Dave Halter 5ab351dc8f Remove unicode literals from code base 2020-07-02 10:43:14 +02:00
Dave Halter f4e537fd72 Remove a lot of sys.version_info references 2020-07-02 02:49:35 +02:00
Dave Halter db28eee760 Remove py__version__ 2020-07-02 02:30:16 +02:00
Dave Halter 0cd6a8f5cc Remove is_py3 and is_py35 2020-07-02 02:23:33 +02:00
Dave Halter 7e295d05a1 Remove some more Python 2/3.5 references 2020-07-02 00:25:00 +02:00
Dave Halter 7f25e28d89 Fix tuple issue in 3.6 2020-05-12 23:33:06 +02:00
Dave Halter 5b54ac835d Fix deprecations in tests 2020-03-21 02:42:00 +01:00
Dave Halter 7de475318a Minor refactoring 2020-03-17 10:00:38 +01:00
Lior Goldberg 1874e9be81 Remove the word 'class' from annotation_string
Currently, 'foo(x: int)' results with annotation_string="<class 'int'>".
Change this to 'int'.
2020-02-20 09:35:01 +01:00
Dave Halter 3388a9659b Catch an error with illegal class instances, fixes #1491 2020-02-03 22:27:48 +01:00
Dave Halter 9c0efd5a67 Prepare a test for #1479 2020-01-25 01:07:20 +01:00
Dave Halter 8cc836e816 find_signatures -> get_signatures, see #1476 2020-01-22 01:10:38 +01:00
Dave Halter 4f56ec5daf Make sure the latest changes work with Python 3.6/3.7 2020-01-10 15:14:22 +01:00
Dave Halter 3ba68b5bc6 Properly convert compiled values to generic classes 2020-01-10 15:09:16 +01:00
Dave Halter cac73f2d44 Make Union/Optional works with compiled objects 2020-01-10 13:34:10 +01:00
Dave Halter ba7776c0d9 Make sure that CompiledValue can deal with string annotations
Fixes #952
Inspired by #1461
2020-01-10 12:40:24 +01:00
Dave Halter 072d506302 Avoid a few warnings 2020-01-10 11:59:11 +01:00
Dave Halter 04a738c014 Remove unnecessary code 2020-01-01 23:11:02 +01:00
Dave Halter 54bd0b437f Make sure that equals will only be added to keyword arguments and not just randomly 2020-01-01 19:00:17 +01:00
Dave Halter 9dc18054ee Make some test code prettier 2020-01-01 17:36:42 +01:00
Dave Halter 5853c67906 Write tests for dict getitem 2019-12-31 18:53:35 +01:00
Dave Halter 83ce8b1162 Make the completions possible for Interpreter objects 2019-12-31 18:34:50 +01:00
Dave Halter 5fc308f1f8 call signature -> signature 2019-12-20 19:41:57 +01:00
Dave Halter d7d9c9642a Don't use goto_definitions anymore, use infer 2019-12-20 19:06:24 +01:00
Dave Halter 2cc898ba35 Get rid of completions in tests 2019-12-20 16:54:51 +01:00