From: Kaliko Jack Date: Fri, 29 Oct 2021 13:49:43 +0000 (+0200) Subject: Cleanup tests code X-Git-Tag: v0.8.0~12 X-Git-Url: https://git.kaliko.me/?a=commitdiff_plain;h=e616985e3da118a4e2b14afe331446633e7e2254;p=python-musicpd.git Cleanup tests code --- diff --git a/test.py b/test.py index 70ac203..2c5094d 100755 --- a/test.py +++ b/test.py @@ -10,21 +10,13 @@ Test suite highly borrowed^Wsteal from python-mpd2 [0] project. import itertools import os -import sys import types import unittest +import unittest.mock as mock import warnings import musicpd -try: - import unittest.mock as mock -except ImportError: - try: - import mock - except ImportError: - print("Please install mock from PyPI to run tests!") - sys.exit(1) # show deprecation warnings warnings.simplefilter('default') @@ -123,7 +115,7 @@ class testEnvVar(unittest.TestCase): client = musicpd.MPDClient() self.assertEqual(client.mpd_timeout, musicpd.CONNECTION_TIMEOUT, - 'Garbage\'s not silently ignore to use default value') + 'Garbage is silently ignore to use default value') os.environ['MPD_TIMEOUT'] = '42' client = musicpd.MPDClient() self.assertEqual(client.mpd_timeout, 42)