Skip to content

Commit 25daf1b

Browse files
Adjust expected result on Windows for os.path.exists
1 parent ec0c176 commit 25daf1b

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

tests/test_inference.py

+8-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66

77
from __future__ import annotations
88

9+
import sys
910
import textwrap
1011
import unittest
1112
from abc import ABCMeta
@@ -32,7 +33,7 @@
3233
from astroid.arguments import CallSite
3334
from astroid.bases import BoundMethod, Instance, UnboundMethod, UnionType
3435
from astroid.builder import AstroidBuilder, _extract_single_node, extract_node, parse
35-
from astroid.const import IS_PYPY, PY39_PLUS, PY310_PLUS
36+
from astroid.const import IS_PYPY, PY39_PLUS, PY310_PLUS, PY312_PLUS
3637
from astroid.context import CallContext, InferenceContext
3738
from astroid.exceptions import (
3839
AstroidTypeError,
@@ -988,7 +989,12 @@ def test_import_as(self) -> None:
988989
self.assertIsInstance(inferred[0], nodes.Module)
989990
self.assertEqual(inferred[0].name, "os.path")
990991
inferred = list(ast.igetattr("e"))
991-
self.assertEqual(len(inferred), 1)
992+
if PY312_PLUS and sys.platform.startswith("win"):
993+
# There are two os.path.exists exported, likely due to
994+
# https://github.com/python/cpython/pull/101324
995+
self.assertEqual(len(inferred), 2)
996+
else:
997+
self.assertEqual(len(inferred), 1)
992998
self.assertIsInstance(inferred[0], nodes.FunctionDef)
993999
self.assertEqual(inferred[0].name, "exists")
9941000

0 commit comments

Comments
 (0)