emmental/tests/util/__init__.py

24 lines
571 B
Python

# Copyright 2022 (c) Anna Schumaker
"""Helper utilities for testing."""
import unittest
import emmental.db
from gi.repository import GObject
class TestCase(unittest.TestCase):
"""A TestCase that handles database setup and cleanup."""
def setUp(self):
"""Set up a database connection."""
self.sql = emmental.db.Connection()
def tearDown(self):
"""Clean up the database connection."""
self.sql.close()
class FloatObject(GObject.GObject):
"""A GObject holding a Float value."""
value = GObject.Property(type=float)