File tree 2 files changed +4
-9
lines changed 2 files changed +4
-9
lines changed Original file line number Diff line number Diff line change @@ -146,6 +146,7 @@ cdef extern from "porttime.h":
146
146
ctypedef long PtTimestamp
147
147
ctypedef void (* PtCallback)(PtTimestamp timestamp, void * userData)
148
148
PtError Pt_Start(int resolution, PtCallback * callback, void * userData)
149
+ PtError Pt_Stop()
149
150
PtTimestamp Pt_Time()
150
151
151
152
cdef long _pypm_initialized
@@ -171,6 +172,7 @@ def Terminate():
171
172
your system may crash.
172
173
173
174
"""
175
+ Pt_Stop()
174
176
Pm_Terminate()
175
177
_pypm_initialized = 0
176
178
Original file line number Diff line number Diff line change 1
1
import unittest
2
- import sys
3
2
4
3
5
4
import pygame
@@ -320,14 +319,8 @@ def test_get_init(self):
320
319
def test_time (self ):
321
320
mtime = pygame .midi .time ()
322
321
self .assertIsInstance (mtime , int )
323
- if "pytest" in sys .modules :
324
- # under pytest the midi module takes a couple of seconds to init
325
- # instead of milliseconds
326
- self .assertGreaterEqual (mtime , 0 )
327
- self .assertLess (mtime , 3000 )
328
- else :
329
- self .assertGreaterEqual (mtime , 0 )
330
- self .assertLess (mtime , 100 )
322
+ # should be close to 2-3... since the timer is just init'd.
323
+ self .assertTrue (0 <= mtime < 100 )
331
324
332
325
333
326
class MidiModuleNonInteractiveTest (unittest .TestCase ):
You can’t perform that action at this time.
0 commit comments