File tree 1 file changed +18
-5
lines changed
1 file changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -54,11 +54,24 @@ def test_attr_matches(self):
54
54
['str.{}(' .format (x ) for x in dir (str )
55
55
if x .startswith ('s' )])
56
56
self .assertEqual (self .stdcompleter .attr_matches ('tuple.foospamegg' ), [])
57
- expected = sorted ({'None.%s%s' % (x ,
58
- '()' if x in ('__init_subclass__' , '__class__' )
59
- else '' if x == '__doc__'
60
- else '(' )
61
- for x in dir (None )})
57
+
58
+ def create_expected_for_none ():
59
+ items = set ()
60
+ for x in dir (None ):
61
+ if (
62
+ x == '__init_subclass__'
63
+ # When `--without-doc-strings` is used, `__class__`
64
+ # won't have a known signature.
65
+ or (x == '__class__' and not MISSING_C_DOCSTRINGS )
66
+ ):
67
+ items .add (f'None.{ x } ()' )
68
+ elif x == '__doc__' :
69
+ items .add (f'None.{ x } ' )
70
+ else :
71
+ items .add (f'None.{ x } (' )
72
+ return sorted (items )
73
+
74
+ expected = create_expected_for_none ()
62
75
self .assertEqual (self .stdcompleter .attr_matches ('None.' ), expected )
63
76
self .assertEqual (self .stdcompleter .attr_matches ('None._' ), expected )
64
77
self .assertEqual (self .stdcompleter .attr_matches ('None.__' ), expected )
You can’t perform that action at this time.
0 commit comments