1616 has_jedi = False
1717
1818from bpython import autocomplete
19- from bpython ._py3compat import py3
2019from bpython .test import mock
2120
22- if py3 :
23- glob_function = "glob.iglob"
24- else :
25- glob_function = "glob.glob"
21+ glob_function = "glob.iglob"
2622
2723
2824class TestSafeEval (unittest .TestCase ):
@@ -235,11 +231,6 @@ def method(self, x):
235231 pass
236232
237233
238- skip_old_style = unittest .skipIf (
239- py3 , "In Python 3 there are no old style classes"
240- )
241-
242-
243234class Properties (Foo ):
244235 @property
245236 def asserts_when_called (self ):
@@ -266,35 +257,6 @@ def test_att_matches_found_on_instance(self):
266257 set (["a.method" , "a.a" , "a.b" ]),
267258 )
268259
269- @skip_old_style
270- def test_att_matches_found_on_old_style_instance (self ):
271- self .assertSetEqual (
272- self .com .matches (2 , "a." , locals_ = {"a" : OldStyleFoo ()}),
273- set (["a.method" , "a.a" , "a.b" ]),
274- )
275- self .assertIn (
276- u"a.__dict__" ,
277- self .com .matches (4 , "a.__" , locals_ = {"a" : OldStyleFoo ()}),
278- )
279-
280- @skip_old_style
281- def test_att_matches_found_on_old_style_class_object (self ):
282- self .assertIn (
283- u"A.__dict__" ,
284- self .com .matches (4 , "A.__" , locals_ = {"A" : OldStyleFoo }),
285- )
286-
287- @skip_old_style
288- def test_issue536 (self ):
289- class OldStyleWithBrokenGetAttr :
290- def __getattr__ (self , attr ):
291- raise Exception ()
292-
293- locals_ = {"a" : OldStyleWithBrokenGetAttr ()}
294- self .assertIn (
295- u"a.__module__" , self .com .matches (4 , "a.__" , locals_ = locals_ )
296- )
297-
298260 def test_descriptor_attributes_not_run (self ):
299261 com = autocomplete .AttrCompletion ()
300262 self .assertSetEqual (
@@ -327,13 +289,6 @@ def test_att_matches_found_on_instance(self):
327289 set (["method" , "a" , "b" ]),
328290 )
329291
330- @skip_old_style
331- def test_att_matches_found_on_old_style_instance (self ):
332- self .assertSetEqual (
333- self .com .matches (5 , "a[0]." , locals_ = {"a" : [OldStyleFoo ()]}),
334- set (["method" , "a" , "b" ]),
335- )
336-
337292 def test_other_getitem_methods_not_called (self ):
338293 class FakeList (object ):
339294 def __getitem__ (inner_self , i ):
@@ -438,7 +393,6 @@ def test_completions_starting_with_different_cases(self):
438393 )
439394 self .assertSetEqual (matches , set (["ade" ]))
440395
441- @unittest .skipUnless (py3 , "asyncio required" )
442396 def test_issue_544 (self ):
443397 com = autocomplete .MultilineJediCompletion ()
444398 code = "@asyncio.coroutine\n def"
@@ -463,10 +417,6 @@ def test_completions_are_unicode(self):
463417 for m in self .com .matches (1 , "a" , locals_ = {"abc" : 10 }):
464418 self .assertIsInstance (m , type (u"" ))
465419
466- @unittest .skipIf (py3 , "in Python 3 invalid identifiers are passed through" )
467- def test_ignores_nonascii_encodable (self ):
468- self .assertEqual (self .com .matches (3 , "abc" , locals_ = {"abcß" : 10 }), None )
469-
470420 def test_mock_kwlist (self ):
471421 with mock .patch .object (keyword , "kwlist" , new = ["abcd" ]):
472422 self .assertEqual (self .com .matches (3 , "abc" , locals_ = {}), None )
@@ -481,11 +431,7 @@ def test_set_of_params_returns_when_matches_found(self):
481431 def func (apple , apricot , banana , carrot ):
482432 pass
483433
484- if py3 :
485- argspec = list (inspect .getfullargspec (func ))
486- else :
487- argspec = list (inspect .getargspec (func ))
488-
434+ argspec = list (inspect .getfullargspec (func ))
489435 argspec = ["func" , argspec , False ]
490436 com = autocomplete .ParameterNameCompletion ()
491437 self .assertSetEqual (
0 commit comments