Skip to content

Commit 427bafc

Browse files
committed
media: add _test_artifact2
The original "_test_artifact" function expects tests to generate their own [unique] filenames. The "_test_artifact2" function will create a unique filename each time it is called. This allows us to remove that burden/maintenance from the tests. Signed-off-by: U. Artie Eoff <[email protected]>
1 parent f799ed3 commit 427bafc

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

.slashrc

+6
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,12 @@ class MediaPlugin(slash.plugins.PluginInterface):
180180
os.remove(tstfile)
181181
return tstfile
182182

183+
def _test_artifact2(self, ext):
184+
count = self._test_state_value((self._test_artifact2, ext), 0)
185+
count.value += 1
186+
filename = f"{slash.context.test.id}_{count.value}.{ext}"
187+
return self._test_artifact(filename)
188+
183189
def _purge_test_artifact(self, filename):
184190
result = slash.context.result
185191

0 commit comments

Comments
 (0)