Changeset 0229e51 for python/tests
- Timestamp:
- Apr 19, 2016, 12:45:56 AM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- fbd7c80
- Parents:
- 9b7f238
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
python/tests/test_sink.py
r9b7f238 r0229e51 30 30 shutil.rmtree(tmpdir) 31 31 32 def test_many_sinks_not_closed(self):33 from tempfile import mkdtemp34 import os.path35 import shutil36 tmpdir = mkdtemp()37 sink_list = []38 try:39 for i in range(many_files):40 path = os.path.join(tmpdir, 'f-' + str(i) + '.wav')41 g = sink(path, 0)42 sink_list.append(g)43 write = 25644 for n in range(200):45 vec = fvec(write)46 g(vec, write)47 except Exception:48 pass49 else:50 self.fail("does not fail on too many files open")51 for g in sink_list:52 g.close()53 shutil.rmtree(tmpdir)54 55 32 def test_read_and_write(self): 56 33 … … 70 47 total_frames += read 71 48 if read < f.hop_size: break 72 if 0:73 print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ),74 print ("(", total_frames, "frames", "in" ),75 print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ),76 print ("from", f.uri ),77 print ("to", g.uri)78 49 del_tmp_sink_path(sink_path) 79 50 … … 95 66 total_frames += read 96 67 if read < f.hop_size: break 97 if 0:98 print ("read", "%.2fs" % (total_frames / float(f.samplerate) ) ),99 print ("(", total_frames, "frames", "in" ),100 print (f.channels, "channels", "in" ),101 print (total_frames / f.hop_size, "blocks", "at", "%dHz" % f.samplerate, ")" ),102 print ("from", f.uri ),103 print ("to", g.uri ),104 print ("in", g.channels, "channels")105 68 del_tmp_sink_path(sink_path) 106 69
Note: See TracChangeset
for help on using the changeset viewer.