MCPcopy
hub / github.com/google-deepmind/acme / test_shared_counts

Method test_shared_counts

acme/utils/counting_test.py:76–84  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

74 self.assertEqual(parent.get_counts(), counter.get_counts())
75
76 def test_shared_counts(self):
77 # Two counters with shared parent should share counts (modulo namespacing).
78 parent = counting.Counter()
79 child1 = counting.Counter(parent, 'child1')
80 child2 = counting.Counter(parent, 'child2')
81 child1.increment(foo=1)
82 result = child2.increment(foo=2)
83 expected = {'child1_foo': 1, 'child2_foo': 2}
84 self.assertEqual(result, expected)
85
86 def test_return_only_prefixed(self):
87 parent = counting.Counter()

Callers

nothing calls this directly

Calls 1

incrementMethod · 0.95

Tested by

no test coverage detected