1
0
mirror of https://github.com/microsoft/qlib.git synced 2026-07-10 22:36:55 +08:00

rename & test

This commit is contained in:
Young
2023-07-04 20:27:51 +08:00
parent 8b0fdf1623
commit aef11536e3
2 changed files with 34 additions and 4 deletions

23
tests/finco/test_utils.py Normal file
View File

@@ -0,0 +1,23 @@
import unittest
from qlib.finco.utils import SingletonBaseClass
class TimeUtils(unittest.TestCase):
def test_singleton(self):
# self.assertEqual(self.to_str(data.tail()), self.to_str(res))
closure_checker = []
class A(SingletonBaseClass):
def __init__(self) -> None:
closure_checker.append(0)
A()
self.assertEqual(len(closure_checker), 1)
A()
self.assertEqual(len(closure_checker), 1)
if __name__ == "__main__":
unittest.main()