mirror of
https://github.com/wassname/catalyst.git
synced 2026-08-11 11:16:15 +08:00
ENH: Well formed exception for any value passed to OrderStyle
This commit adds support for arbitrary objects in addition to NaN and infinity values. The object well be returned in string format as part of the error message.
This commit is contained in:
@@ -62,7 +62,19 @@ class ExecutionStyleTestCase(TestCase):
|
||||
for delta in range(1, 10)
|
||||
]
|
||||
|
||||
INVALID_PRICES = [(-1,), (-1.0,), (0 - epsilon,), (float('nan'),)]
|
||||
class ArbitraryObject():
|
||||
def __str__(self):
|
||||
return """This should yield a bad order error when
|
||||
passed as a stop or limit price."""
|
||||
|
||||
INVALID_PRICES = [
|
||||
(-1,),
|
||||
(-1.0,),
|
||||
(0 - epsilon,),
|
||||
(float('nan'),),
|
||||
(float('inf'),),
|
||||
(ArbitraryObject(),),
|
||||
]
|
||||
|
||||
def setUp(self):
|
||||
setup_logger(self)
|
||||
|
||||
Reference in New Issue
Block a user