(self, checkpointer_cls)
| 921 | ckpt.stop() |
| 922 | self.assertIsNone(ckpt._gc_thread) |
| 923 | |
| 924 | @parameterized.parameters([Checkpointer, OrbaxCheckpointer]) |
| 925 | def test_context(self, checkpointer_cls): |
| 926 | ckpt = _checkpointer_config(checkpointer_cls).instantiate(parent=None) |
| 927 | |
| 928 | if checkpointer_cls is Checkpointer: |
| 929 | with ckpt: |
| 930 | self.assertIsNotNone(ckpt._gc_thread) |
| 931 | self.assertIsNone(ckpt._gc_thread) |
| 932 | |
| 933 | # Nested contexts are not supported. |
| 934 | with ckpt: |
| 935 | with self.assertRaisesRegex(ValueError, "Already in a context"): |
| 936 | with ckpt: |
| 937 | pass |
| 938 | |
| 939 | if checkpointer_cls is Checkpointer: |
| 940 | self.assertIsNone(ckpt._gc_thread) |
| 941 |
nothing calls this directly
no test coverage detected