MCPcopy Create free account
hub / github.com/google-deepmind/dm_control / test_free

Method test_free

dm_control/_render/base_test.py:98–111  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

96 self.assertEqual(second_context.make_current_count, 2)
97
98 def test_free(self):
99 with self.context.make_current():
100 pass
101
102 thread = self.context.thread
103 self.assertIn(id(self.context), base._CURRENT_THREAD_FOR_CONTEXT)
104 self.assertIn(thread, base._CURRENT_CONTEXT_FOR_THREAD)
105
106 self.context.free()
107 self.assertIs(self.context.free_thread, thread)
108 self.assertIsNone(self.context.thread)
109
110 self.assertNotIn(id(self.context), base._CURRENT_THREAD_FOR_CONTEXT)
111 self.assertNotIn(thread, base._CURRENT_CONTEXT_FOR_THREAD)
112
113 def test_free_with_multiple_contexts(self):
114 context1 = ContextBaseTests.ContextMock(WIDTH, HEIGHT,

Callers

nothing calls this directly

Calls 2

make_currentMethod · 0.80
freeMethod · 0.45

Tested by

no test coverage detected