python-jedi/fix_test_compiled_signature_annotation_string.patch
Matej Cepl 652d84257c Accepting request 1064746 from home:dirkmueller:acdc
- Add supported_pythons_310_311.patch which includes '3.11' among
  _SUPPORTED_PYTHONS (gh#davidhalter/jedi#1914).

- Add fix_test_compiled_signature_annotation_string.patch to make
  test passing with Python 3.10+ (gh#davidhalter/jedi#1732).

OBS-URL: https://build.opensuse.org/request/show/1064746
OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-jedi?expand=0&rev=99
2023-02-13 00:00:46 +00:00

35 lines
1.4 KiB
Diff

---
test/test_inference/test_mixed.py | 8 ++++++--
test/test_utils.py | 2 +-
2 files changed, 7 insertions(+), 3 deletions(-)
--- a/test/test_inference/test_mixed.py
+++ b/test/test_inference/test_mixed.py
@@ -1,3 +1,4 @@
+import sys
from typing import Generic, TypeVar, List
import pytest
@@ -110,5 +111,8 @@ def test_compiled_signature_annotation_s
func.__name__ = 'not_func'
s, = jedi.Interpreter('func()', [locals()]).get_signatures(1, 5)
- assert s.params[0].description == 'param x: Type'
- assert s.params[1].description == 'param y: Union[Type, int]'
+ assert s.params[0].description == 'param x: Type' \
+ if sys.version_info < (3, 10, 0) else "param x: 'typing.Type'"
+ assert s.params[1].description == 'param y: Union[Type, int]' \
+ if sys.version_info < (3, 10, 0) else "param y: 'typing.Union[typing.Type, int]"
+
--- a/test/test_utils.py
+++ b/test/test_utils.py
@@ -81,7 +81,7 @@ class TestSetupReadline(unittest.TestCas
if all(not x.startswith('from os import ' + s)
for s in ['_', 'O_', 'EX_', 'MFD_', 'SF_', 'ST_',
'CLD_', 'POSIX_SPAWN_', 'P_', 'RWF_',
- 'SCHED_'])
+ 'SCHED_', 'SPLICE_', 'EFD_', 'eventfd'])
}
# There are quite a few differences, because both Windows and Linux
# (posix and nt) librariesare included.