MCPcopy Create free account
hub / github.com/bslatkin/effectivepython / write_test_files

Function write_test_files

example_code/item_052.py:133–137  ·  view source on GitHub ↗
(tmpdir)

Source from the content-addressed store, hash-verified

131import random
132
133def write_test_files(tmpdir):
134 os.makedirs(tmpdir)
135 for i in range(100):
136 with open(os.path.join(tmpdir, str(i)), "w") as f:
137 f.write("\n" * random.randint(0, 100))
138
139tmpdir = "test_inputs"
140write_test_files(tmpdir)

Callers 1

item_052.pyFile · 0.85

Calls 2

openFunction · 0.85
writeMethod · 0.80

Tested by

no test coverage detected