mirror of
https://github.com/wassname/catalyst.git
synced 2026-09-10 11:50: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 unittest import TestCase
|
||||||
from zipline.assets._securities import Security
|
from zipline.assets._securities import Security
|
||||||
|
|
||||||
@@ -29,5 +30,11 @@ class TestSecurityRichCmp(TestCase):
|
|||||||
self.assertTrue(Security(5) > Security(4))
|
self.assertTrue(Security(5) > Security(4))
|
||||||
|
|
||||||
def test_type_mismatch(self):
|
def test_type_mismatch(self):
|
||||||
self.assertIsNotNone(Security(3) < 'a')
|
if sys.version_info.major < 3:
|
||||||
self.assertIsNotNone('a' < Security(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