File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,20 @@ def test_obj_serializer_ephemeral_writes_to_tempdir(tmp_path: Path):
99
99
assert not Path (tmp_path , obj_1_name ).exists ()
100
100
101
101
102
+ def test_obj_serializer_ephemeral_deletes_dangling_tempdirs_on_init (tmp_path : Path ):
103
+ tempdir = tmp_path / "tmpdir"
104
+ tempdir .mkdir ()
105
+ ObjectSerializerDisk [MockDataclass ](tmp_path , ephemeral = True )
106
+ assert not tempdir .exists ()
107
+
108
+
109
+ def test_obj_serializer_does_not_delete_tempdirs_on_init (tmp_path : Path ):
110
+ tempdir = tmp_path / "tmpdir"
111
+ tempdir .mkdir ()
112
+ ObjectSerializerDisk [MockDataclass ](tmp_path , ephemeral = False )
113
+ assert tempdir .exists ()
114
+
115
+
102
116
def test_obj_serializer_disk_different_types (tmp_path : Path ):
103
117
obj_serializer_1 = ObjectSerializerDisk [MockDataclass ](tmp_path )
104
118
obj_1 = MockDataclass (foo = "bar" )
You can’t perform that action at this time.
0 commit comments