Skip to content

Commit

Permalink
Accidentally made it so the tests weren't being run on Mac or Linux.
Browse files Browse the repository at this point in the history
  • Loading branch information
TaylorSMarks committed Jul 2, 2021
1 parent 9eb3c97 commit 9095930
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion test.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
isTravis = environ.get('TRAVIS', 'false') == 'true'

from playsound import playsound, PlaysoundException
from unittest.mock import patch
import unittest

durationMarginLow = 0.3
Expand All @@ -34,11 +33,14 @@ def helper(self, file, approximateDuration, block = True):
print(path)

if isTravis and system == 'Windows':
from unittest.mock import patch
with patch('ctypes.windll.winmm.mciSendStringW', side_effect = mockMciSendStringW):
global sawClose
sawClose = False
playsound(path, block = block)
self.assertTrue(sawClose)
else:
playsound(path, block = block)
duration = time() - startTime
self.assertTrue(approximateDuration - durationMarginLow <= duration <= approximateDuration + duratingMarginHigh, 'File "{}" took an unexpected amount of time: {}'.format(file.encode('utf-8'), duration))

Expand Down

0 comments on commit 9095930

Please sign in to comment.