From fb3ac0765d30d8d1d3a4ac700d992716f2d14e00 Mon Sep 17 00:00:00 2001 From: Stefan Behnel Date: Sat, 2 Apr 2011 11:58:08 +0200 Subject: [PATCH] added disabled test case for type inference in generators --- tests/bugs.txt | 1 + tests/run/generator_type_inference.pyx | 13 +++++++++++++ 2 files changed, 14 insertions(+) create mode 100644 tests/run/generator_type_inference.pyx diff --git a/tests/bugs.txt b/tests/bugs.txt index c8845007..f1478a3b 100644 --- a/tests/bugs.txt +++ b/tests/bugs.txt @@ -18,6 +18,7 @@ genexpr_iterable_lookup_T600 for_from_pyvar_loop_T601 decorators_T593 temp_sideeffects_T654 +generator_type_inference # CPython regression tests that don't current work: pyregr.test_threadsignals diff --git a/tests/run/generator_type_inference.pyx b/tests/run/generator_type_inference.pyx new file mode 100644 index 00000000..d8c7c852 --- /dev/null +++ b/tests/run/generator_type_inference.pyx @@ -0,0 +1,13 @@ +# mode: run +# tag: typeinference, generators + +cimport cython + +def test_type_inference(): + """ + >>> [ item for item in test_type_inference() ] + [(2.0, 'double'), (2.0, 'double'), (2.0, 'double')] + """ + x = 1.0 + for i in range(3): + yield x * 2.0, cython.typeof(x) -- 2.26.2