From 3dc5b86f22933d7215d617287dd0b165423bee33 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Alexander=20Niederb=C3=BChl?= Date: Sat, 11 Jan 2020 18:24:50 +0100 Subject: [PATCH] Add subclassing testcase which previously caused a segfault Add a testcase from #407. Both test cases don't segfault after the change to the #[pyclass] system in #683. Closes #407 --- examples/rustapi_module/tests/test_subclassing.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/examples/rustapi_module/tests/test_subclassing.py b/examples/rustapi_module/tests/test_subclassing.py index 497b2318..ccd61aa7 100644 --- a/examples/rustapi_module/tests/test_subclassing.py +++ b/examples/rustapi_module/tests/test_subclassing.py @@ -9,6 +9,7 @@ class SomeSubClass(Subclassable): pass -if not PYPY: - a = SomeSubClass() - _b = str(a) + repr(a) +def test_subclassing(): + if not PYPY: + a = SomeSubClass() + _b = str(a) + repr(a)