Generate one random string.
(nchars)
| 114 | |
| 115 | |
| 116 | def rands(nchars): |
| 117 | """ |
| 118 | Generate one random string. |
| 119 | """ |
| 120 | RANDS_CHARS = list(string.ascii_letters + string.digits) |
| 121 | return "".join(random.choice(RANDS_CHARS) for i in range(nchars)) |
| 122 | |
| 123 | |
| 124 | def memory_leak_check(f, metric='rss', threshold=1 << 17, iterations=10, |