class_docstr: Unittests for the tracker class
class_docstr_tok: ["Unittests","for","the","tracker","class"]
docstr: Assert entering and exit work as expected
docstr_tok: ["Assert","entering","and","exit","work","as","expected"]
code: def test_enter_and_exit(self):
      """Assert entering and exit work as expected"""
  
      tracker = Tracker()
      tracker.totals = {"a": 1}
      tracker.history = {"a": [1]}
      tracker.latest = {"a": 1}
  
      returned = tracker.__enter__()
  
      assert id(tracker) == id(returned)
      assert tracker.active is True
  
      assert tracker.totals == dict()
      assert tracker.history == dict()
      assert tracker.latest == dict()
  
      tracker.__exit__(None, None, None)
  
      assert tracker.active is False
  
file_path: pennylane/tests/test_tracker.py
imports: import pytest
  import pennylane
  from pennylane import Tracker
label_desc: Use image node_id 6 for calling the TestTrackerCoreBehavior obj's underlying member method code with example usage: obj.test_enter_and_exit() without return types