File tree Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Expand file tree Collapse file tree 2 files changed +3
-11
lines changed Original file line number Diff line number Diff line change 1919
2020def _looks_like_parents_subscript (node : nodes .Subscript ) -> bool :
2121 if not (
22- isinstance (node .value , nodes .Name )
23- or isinstance (node .value , nodes .Attribute )
24- and node .value .attrname == "parents"
22+ isinstance (node .value , nodes .Attribute ) and node .value .attrname == "parents"
2523 ):
2624 return False
2725
Original file line number Diff line number Diff line change @@ -28,20 +28,14 @@ def test_inference_parents() -> None:
2828
2929def test_inference_parents_subscript_index () -> None :
3030 """Test inference of ``pathlib.Path.parents``, accessed by index."""
31- parents , path = astroid .extract_node (
31+ path = astroid .extract_node (
3232 """
3333 from pathlib import Path
3434
3535 current_path = Path().resolve()
36- path_parents = current_path.parents
37- path_parents #@
38- path_parents[2] #@
36+ current_path.parents[2] #@
3937 """
4038 )
41- inferred = parents .inferred ()
42- assert len (inferred ) == 1
43- assert isinstance (inferred [0 ], bases .Instance )
44- assert inferred [0 ].qname () == "pathlib._PathParents"
4539
4640 inferred = path .inferred ()
4741 assert len (inferred ) == 1
You can’t perform that action at this time.
0 commit comments