From 90959309a173e49bda288be49bc1cd5720589fb1 Mon Sep 17 00:00:00 2001 From: Taylor Date: Fri, 2 Jul 2021 01:54:40 -0400 Subject: [PATCH] Accidentally made it so the tests weren't being run on Mac or Linux. --- test.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test.py b/test.py index 85ce922..61fd5c6 100644 --- a/test.py +++ b/test.py @@ -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 @@ -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))