Skip to content

Commit ed06789

Browse files
authored
Add copy_asset test helper. NFC (emscripten-core#26431)
1 parent ffef6ac commit ed06789

File tree

4 files changed

+105
-96
lines changed

4 files changed

+105
-96
lines changed

test/common.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -115,6 +115,11 @@ def test_file(*path_components):
115115
return str(Path(TEST_ROOT, *path_components))
116116

117117

118+
def copy_asset(filename, target='.'):
119+
"""Copies file/asset from the test directory into the CWD."""
120+
return shutil.copy(test_file(filename), target)
121+
122+
118123
def maybe_test_file(filename):
119124
if not os.path.exists(filename) and os.path.exists(test_file(filename)):
120125
filename = test_file(filename)

0 commit comments

Comments
 (0)