MCPcopy Create free account
hub / github.com/bspaans/python-mingus / setUp

Method setUp

tests/integration/test_fluidsynth.py:28–41  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

26 """
27
28 def setUp(self):
29 soundfont = os.getenv("SOUNDFONT")
30 if soundfont is None:
31 raise ValueError(
32 "A soundfont (*.sf2) file path must be provided in the SOUNDFONT environment variable"
33 )
34
35 self.tempdir = tempfile.mkdtemp()
36 output_file = os.path.join(self.tempdir, "test.wav")
37
38 fluidsynth.init(soundfont, file=output_file)
39 fluidsynth.set_instrument(0, 0)
40 s = SequencerObserver()
41 fluidsynth.midi.attach(s)
42
43 def tearDown(self):
44 shutil.rmtree(self.tempdir)

Callers

nothing calls this directly

Calls 4

SequencerObserverClass · 0.90
attachMethod · 0.80
initMethod · 0.45
set_instrumentMethod · 0.45

Tested by

no test coverage detected