MCPcopy Create free account
hub / github.com/mlco2/codecarbon / test_first_tracking_tutorial

Function test_first_tracking_tutorial

tests/test_docs_examples.py:41–53  ·  view source on GitHub ↗

Test tutorial with sequential code blocks. The first-tracking.md tutorial has blocks that depend on each other: 1. Run tracker (creates emissions.csv) 2. Read emissions.csv with pandas 3. Access tracker.final_emissions Use memory=True so blocks can share state.

(tmp_path, monkeypatch)

Source from the content-addressed store, hash-verified

39
40
41def test_first_tracking_tutorial(tmp_path, monkeypatch):
42 """Test tutorial with sequential code blocks.
43
44 The first-tracking.md tutorial has blocks that depend on each other:
45 1. Run tracker (creates emissions.csv)
46 2. Read emissions.csv with pandas
47 3. Access tracker.final_emissions
48
49 Use memory=True so blocks can share state.
50 """
51 monkeypatch.chdir(tmp_path)
52 abs_fpath = Path(__file__).parent.parent / "docs/tutorials/first-tracking.md"
53 check_md_file(str(abs_fpath), memory=True)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…