mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-09-27 10:03:11 +07:00
PY-91903 Guard recursive while-loop inference test
With better control-flow inference disabled, code-analysis and user-initiated contexts can infer different types for the loop. Run the test only when the inference mode it was written for is enabled. (cherry picked from commit d7eaaf17258702d94731882b668c354713a5e633) IJ-MR-221796 GitOrigin-RevId: b0a3c075288003a5a7b87913c255710c568c1f83
This commit is contained in:
committed by
intellij-monorepo-bot
parent
0cbcaf3e49
commit
0a36c2119a
@@ -249,13 +249,17 @@ class PyInferenceMiscTypeTest : PyCodeInsightTestCase() {
|
||||
inner class RecursionAndFixedPointLoops {
|
||||
@Test
|
||||
@TestFor(issues = ["PY-76659"])
|
||||
fun `recursive resolve in while loop`() = test("""
|
||||
x = 42
|
||||
while x:
|
||||
x = x + 1
|
||||
expr = x
|
||||
#└ TYPE Literal[42] | int
|
||||
""")
|
||||
fun `recursive resolve in while loop`() {
|
||||
if (!Registry.`is`("python.use.better.control.flow.type.inference")) return
|
||||
|
||||
test("""
|
||||
x = 42
|
||||
while x:
|
||||
x = x + 1
|
||||
expr = x
|
||||
#└ TYPE Literal[42] | int
|
||||
""")
|
||||
}
|
||||
|
||||
@Test
|
||||
@TestFor(issues = ["PY-76659"])
|
||||
|
||||
Reference in New Issue
Block a user