Skip to content

Getting error with Chapter 7, Trading Strategy Unit Test #12

@jbh1128d1

Description

@jbh1128d1

Hello,

I keep getting the following bug when trying to run the unit test for Trading Strategy.

TradingStrategy_ut.py::TestMarketSimulator::test_filled_order FAILED     [ 33%]
TradingStrategy_ut.py:45 (TestMarketSimulator.test_filled_order)
self = <TradingStrategy_ut.TestMarketSimulator testMethod=test_filled_order>

    def setUp(self):
>       self.trading_strategy= TradingStrategy()
E       TypeError: __init__() missing 3 required positional arguments: 'ob_2_ts', 'ts_2_om', and 'om_2_ts'

TradingStrategy_ut.py:8: TypeError
FAILED [ 66%]
TradingStrategy_ut.py:10 (TestMarketSimulator.test_receive_top_of_book)
self = <TradingStrategy_ut.TestMarketSimulator testMethod=test_receive_top_of_book>

    def setUp(self):
>       self.trading_strategy= TradingStrategy()
E       TypeError: __init__() missing 3 required positional arguments: 'ob_2_ts', 'ts_2_om', and 'om_2_ts'

TradingStrategy_ut.py:8: TypeError
FAILED   [100%]
TradingStrategy_ut.py:29 (TestMarketSimulator.test_rejected_order)
self = <TradingStrategy_ut.TestMarketSimulator testMethod=test_rejected_order>

    def setUp(self):
>       self.trading_strategy= TradingStrategy()
E       TypeError: __init__() missing 3 required positional arguments: 'ob_2_ts', 'ts_2_om', and 'om_2_ts'

TradingStrategy_ut.py:8: TypeError

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions