Skip to content

Commit

Permalink
Yet more logging.
Browse files Browse the repository at this point in the history
  • Loading branch information
gbeced committed Dec 14, 2023
1 parent 69cfae4 commit 3353b24
Showing 1 changed file with 17 additions and 10 deletions.
27 changes: 17 additions & 10 deletions tests/test_backtesting_charts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,32 @@
# See the License for the specific language governing permissions and
# limitations under the License.

trace_nr = 1

def trace(msg=""):
global trace_nr
if trace_nr == 1:
print()
print(trace_nr, msg)
trace_nr += 1


trace("imports")
from decimal import Decimal
import asyncio
import datetime
import os

trace("imports")
import pytest

trace("imports")
from . import helpers
trace("imports")
from basana.backtesting import charts, exchange
trace("imports")
from basana.core.pair import Pair
trace("imports")
from basana.external.yahoo import bars
trace("imports")


@pytest.mark.parametrize("order_plan", [
Expand All @@ -40,13 +55,6 @@
},
])
def test_save_line_chart(order_plan, backtesting_dispatcher, caplog):
trace_nr = 1

def trace():
nonlocal trace_nr
print(trace_nr)
trace_nr += 1

print()
trace()
e = exchange.Exchange(
Expand Down Expand Up @@ -81,7 +89,6 @@ async def on_bar(bar_event):
assert created_order is not None

async def impl():
trace()
e.add_bar_source(bars.CSVBarSource(pair, helpers.abs_data_path("orcl-2000-yahoo-sorted.csv")))
trace()
e.subscribe_to_bar_events(pair, on_bar)
Expand Down

0 comments on commit 3353b24

Please # to comment.