@@ -12,8 +12,8 @@ def test_timeline_tempo():
12
12
assert timeline .clock_source .tempo == pytest .approx (100 )
13
13
14
14
def test_timeline_default_output_device ():
15
- timeline = iso .Timeline ()
16
15
try :
16
+ timeline = iso .Timeline ()
17
17
track = timeline .schedule ({ "note" : 0 })
18
18
assert issubclass (type (track .output_device ), MidiOutputDevice )
19
19
except iso .DeviceNotFoundException :
@@ -271,18 +271,26 @@ def callback():
271
271
assert dummy_timeline .done
272
272
273
273
def test_timeline_beats_to_seconds (dummy_timeline ):
274
- timeline = iso .Timeline (120 )
275
- assert timeline .beats_to_seconds (1 ) == pytest .approx (0.5 )
276
- assert timeline .beats_to_seconds (0 ) == pytest .approx (0.0 )
277
- timeline .tempo = 180
278
- assert timeline .beats_to_seconds (1 ) == pytest .approx (1 / 3 )
274
+ try :
275
+ timeline = iso .Timeline (120 )
276
+ assert timeline .beats_to_seconds (1 ) == pytest .approx (0.5 )
277
+ assert timeline .beats_to_seconds (0 ) == pytest .approx (0.0 )
278
+ timeline .tempo = 180
279
+ assert timeline .beats_to_seconds (1 ) == pytest .approx (1 / 3 )
280
+ except iso .DeviceNotFoundException :
281
+ # Ignore exception on machines without a MIDI device
282
+ pass
279
283
280
284
def test_timeline_seconds_to_beats (dummy_timeline ):
281
- timeline = iso .Timeline (120 )
282
- assert timeline .seconds_to_beats (1 ) == pytest .approx (2 )
283
- assert timeline .seconds_to_beats (0 ) == pytest .approx (0.0 )
284
- timeline .tempo = 180
285
- assert timeline .seconds_to_beats (1 ) == pytest .approx (3 )
285
+ try :
286
+ timeline = iso .Timeline (120 )
287
+ assert timeline .seconds_to_beats (1 ) == pytest .approx (2 )
288
+ assert timeline .seconds_to_beats (0 ) == pytest .approx (0.0 )
289
+ timeline .tempo = 180
290
+ assert timeline .seconds_to_beats (1 ) == pytest .approx (3 )
291
+ except iso .DeviceNotFoundException :
292
+ # Ignore exception on machines without a MIDI device
293
+ pass
286
294
287
295
def test_timeline_tempo (dummy_timeline ):
288
296
# Set tempo of internal clock
0 commit comments