Skip to content

Commit ac23e16

Browse files
committed
Python: Move Python 3.15 data-flow tests to a separate file
We won't be able to run these tests until Python 3.15 is actually out (and our CI is using it), so it seemed easiest to just put them in their own test directory.
1 parent dc36609 commit ac23e16

File tree

4 files changed

+29
-26
lines changed

4 files changed

+29
-26
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
missingAnnotationOnSink
2+
testFailures
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
import python
2+
import utils.test.dataflow.NormalDataflowTest
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# PEP 798: Unpacking in comprehensions.
2+
# These desugar to `yield from`, so flow depends on yield-from support.
3+
4+
def test_star_list_comp():
5+
l = [[SOURCE]]
6+
flat = [*x for x in l]
7+
SINK(flat[0]) # $ MISSING:flow="SOURCE, l:-2 -> flat[0]"
8+
9+
10+
def test_star_set_comp():
11+
l = [[SOURCE]]
12+
flat = {*x for x in l}
13+
SINK(flat.pop()) # $ MISSING:flow="SOURCE, l:-2 -> flat.pop()"
14+
15+
16+
def test_star_genexp():
17+
l = [[SOURCE]]
18+
g = (*x for x in l)
19+
SINK(next(g)) # $ MISSING:flow="SOURCE, l:-2 -> next()"
20+
21+
22+
def test_star_dictcomp():
23+
l = [{"key": SOURCE}]
24+
merged = {**d for d in l}
25+
SINK(merged["key"]) # $ MISSING:flow="SOURCE, l:-2 -> merged[..]"

python/ql/test/library-tests/dataflow/coverage/test.py

Lines changed: 0 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -257,32 +257,6 @@ def test_yield_from():
257257
SINK(next(g)) # $ MISSING:flow="SOURCE, l:-1 -> next()"
258258

259259

260-
# PEP 798: Unpacking in comprehensions.
261-
# These desugar to `yield from`, so flow depends on yield-from support (see above).
262-
def test_star_list_comp():
263-
l = [[SOURCE]]
264-
flat = [*x for x in l]
265-
SINK(flat[0]) # $ MISSING:flow="SOURCE, l:-2 -> flat[0]"
266-
267-
268-
def test_star_set_comp():
269-
l = [[SOURCE]]
270-
flat = {*x for x in l}
271-
SINK(flat.pop()) # $ MISSING:flow="SOURCE, l:-2 -> flat.pop()"
272-
273-
274-
def test_star_genexp():
275-
l = [[SOURCE]]
276-
g = (*x for x in l)
277-
SINK(next(g)) # $ MISSING:flow="SOURCE, l:-2 -> next()"
278-
279-
280-
def test_star_dictcomp():
281-
l = [{"key": SOURCE}]
282-
merged = {**d for d in l}
283-
SINK(merged["key"]) # $ MISSING:flow="SOURCE, l:-2 -> merged[..]"
284-
285-
286260
# a statement rather than an expression, but related to generators
287261
def test_for():
288262
for x in gen(SOURCE):

0 commit comments

Comments
 (0)