Skip to content

Commit 683a474

Browse files
committed
Add news entry and more precise tests
1 parent 14def5e commit 683a474

2 files changed

Lines changed: 9 additions & 10 deletions

File tree

Lib/test/test_ast_jy.py

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -151,19 +151,17 @@ class TestAstList(unittest.TestCase):
151151

152152
def test_concat(self):
153153
# Issue gh-356 Java IndexOOB error on append
154-
body = ast.parse('x=1').body # _ast.AstList
155-
p = [ast.Pass()] # PyList
154+
body = ast.parse('x=1; global y; y+=x*2').body # _ast.AstList
155+
p = [ast.Pass(), ast.Break()] # PyList
156156
x = body + p
157-
self.assertEqual(2, len(x))
158-
self.assertIsInstance(x[1], ast.Pass)
157+
self.assertEqual(x[-2:], p)
159158

160159
def test_append(self):
161160
# Issue gh-356 Java IndexOOB error on append
162-
body = ast.parse('x=1').body # _ast.AstList
163-
p = [ast.Pass()] # PyList
161+
body = ast.parse('x=1; global y; y+=x*2').body # _ast.AstList
162+
p = [ast.Pass(), ast.Break()] # PyList
164163
body += p
165-
self.assertEqual(2, len(body))
166-
self.assertIsInstance(body[1], ast.Pass)
164+
self.assertEqual(body[-2:], p)
167165

168166

169167
#==============================================================================

NEWS

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,9 @@ New Features
2929
deprecated for removal in Java 26. See https://github.com/jnr/jffi/issues/165
3030

3131
Jython 2.7.5a1 Bugs fixed
32-
- [ GH-382 ] Java EE Servlet Namespace Has Been Changed From javax.servlet to jakarta.servlet
33-
- [ GH-84 ] PyServlet Will Need To Use The jakarta.servlet Namespace #84
32+
- [ GH-382 ] Java EE Servlet namespace changed from javax.servlet to jakarta.servlet
33+
- [ GH-356 ] _ast.astlist.__add__ leads to Java exception
34+
- [ GH-84 ] PyServlet will need to use the jakarta.servlet namespace
3435

3536

3637
==============================================================================

0 commit comments

Comments
 (0)