[pypy-commit] pypy default: A failing test showing a pervasive issue with unions of objects of different types
rlamy
pypy.commits at gmail.com
Tue Nov 22 11:44:17 EST 2016
Author: Ronan Lamy <ronan.lamy at gmail.com>
Branch:
Changeset: r88548:b0e65fd580b2
Date: 2016-11-22 16:30 +0000
http://bitbucket.org/pypy/pypy/changeset/b0e65fd580b2/
Log: A failing test showing a pervasive issue with unions of objects of
different types
diff --git a/rpython/annotator/test/test_model.py b/rpython/annotator/test/test_model.py
--- a/rpython/annotator/test/test_model.py
+++ b/rpython/annotator/test/test_model.py
@@ -192,6 +192,20 @@
assert union(union(s1, s2), s3) == union(s1, union(s2, s3))
+ at pytest.mark.xfail
+ at given(st_annotation, st_annotation)
+def test_generalize_isinstance(annotator, s1, s2):
+ try:
+ s_12 = union(s1, s2)
+ except UnionError:
+ assume(False)
+ assume(s1 != s_ImpossibleValue)
+ from rpython.annotator.unaryop import s_isinstance
+ s_int = annotator.bookkeeper.immutablevalue(int)
+ s_res_12 = s_isinstance(annotator, s_12, s_int, [])
+ s_res_1 = s_isinstance(annotator, s1, s_int, [])
+ assert s_res_12.contains(s_res_1)
+
def compile_function(function, annotation=[]):
t = TranslationContext()
t.buildannotator().build_types(function, annotation)
More information about the pypy-commit
mailing list