From c43098d5bd91b6af733cb19225ebaf29228c2c50 Mon Sep 17 00:00:00 2001 From: David Sklar <177495+davidsklar@users.noreply.github.com> Date: Thu, 29 Dec 2022 13:37:27 -0500 Subject: Python: test cleanups 1. Remove references to modules (exceptions, StringIO) no longer needed for Pythn3 2. Use assertEqual instead of assertEquals 3. Clear journal files with a close_journal_files() function that uses the then-current underlying python_session pointer. Calling session.close_journal_files() sometimes leads to segfaults because python_session has changed after it was injected into the python module (as "session") on module startup. --- test/python/PostingTest.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) (limited to 'test/python/PostingTest.py') diff --git a/test/python/PostingTest.py b/test/python/PostingTest.py index f191253e..0dd18112 100644 --- a/test/python/PostingTest.py +++ b/test/python/PostingTest.py @@ -1,11 +1,9 @@ # -*- coding: utf-8 -*- import unittest -import exceptions import operator from ledger import * -from StringIO import * from datetime import * class PostingTestCase(unittest.TestCase): @@ -13,7 +11,7 @@ class PostingTestCase(unittest.TestCase): pass def tearDown(self): - pass + close_journal_files() def test_(self): pass -- cgit v1.2.3