mirror of
https://github.com/wassname/catalyst.git
synced 2026-06-28 15:04:32 +08:00
TEST: Update Security class unit tests for Python3 compatibility
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import sys
|
||||
from unittest import TestCase
|
||||
from zipline.assets._securities import Security
|
||||
|
||||
@@ -29,5 +30,11 @@ class TestSecurityRichCmp(TestCase):
|
||||
self.assertTrue(Security(5) > Security(4))
|
||||
|
||||
def test_type_mismatch(self):
|
||||
self.assertIsNotNone(Security(3) < 'a')
|
||||
self.assertIsNotNone('a' < Security(3))
|
||||
if sys.version_info.major < 3:
|
||||
self.assertIsNotNone(Security(3) < 'a')
|
||||
self.assertIsNotNone('a' < Security(3))
|
||||
else:
|
||||
with self.assertRaises(TypeError):
|
||||
Security(3) < 'a'
|
||||
with self.assertRaises(TypeError):
|
||||
'a' < Security(3)
|
||||
|
||||
Reference in New Issue
Block a user