From d7265e672035c29b486929caf49d5a9246421d8a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Diego=20Elio=20Petten=C3=B2?= Date: Thu, 15 Nov 2018 23:52:39 +0000 Subject: tests: simplify and cleanup. * Remove the __main__ blocks as the tests should not be executable by themselves. * Use absltest everywhere instead of a mixture of unittest/absltest (via parameterized). * Only modify import path once. * Cleanup pylint warnings, by disabling those that are not useful, and fixing those that are. --- test/test_lifescan.py | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) mode change 100644 => 100755 test/test_lifescan.py (limited to 'test/test_lifescan.py') diff --git a/test/test_lifescan.py b/test/test_lifescan.py old mode 100644 new mode 100755 index 5781829..45f2c1c --- a/test/test_lifescan.py +++ b/test/test_lifescan.py @@ -6,16 +6,16 @@ __email__ = 'flameeyes@flameeyes.eu' __copyright__ = 'Copyright © 2013-2017, Diego Elio Pettenò' __license__ = 'MIT' +# pylint: disable=protected-access,missing-docstring + import array -import os -import sys -import unittest -sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__)))) +from absl.testing import absltest from glucometerutils.support import lifescan -class TestChecksum(unittest.TestCase): + +class TestChecksum(absltest.TestCase): def test_crc(self): self.assertEqual( 0x41cd, @@ -26,7 +26,3 @@ class TestChecksum(unittest.TestCase): self.assertEqual( 0x62C2, lifescan.crc_ccitt(cmd_array)) - - -if __name__ == '__main__': - unittest.main() -- cgit v1.2.3