(self)
| 1812 | |
| 1813 | @test_util.run_v1_only('b/120545219') |
| 1814 | def testAsDefault(self): |
| 1815 | c = constant_op.constant(37) |
| 1816 | sess = session.Session() |
| 1817 | with sess.as_default(): |
| 1818 | self.assertEqual(37, c.eval()) |
| 1819 | |
| 1820 | # Ensure that the session remains valid even when it is not captured. |
| 1821 | with session.Session().as_default(): |
| 1822 | self.assertEqual(37, c.eval()) |
| 1823 | |
| 1824 | def testReentry(self): |
| 1825 | sess = session.Session() |
nothing calls this directly
no test coverage detected