diff --git a/tests/test_codec_common.py b/tests/test_codec_common.py index 8fa80cc..30e9979 100644 --- a/tests/test_codec_common.py +++ b/tests/test_codec_common.py @@ -27,3 +27,10 @@ def test_unpack_invalid_words(self): words = 3 * b'\x00' # length not even with self.assertRaises(ValueError): codec_common.unpack_words(words) + + +if __name__ == '__main__': + # This enables running the unit tests by running this script which is + # much more convenient than 'python setup.py test' while developing tests. + # Note: package-under-test needs to be in python-path + unittest.main() diff --git a/tests/test_datamatrix.py b/tests/test_datamatrix.py index 03bf77b..5f28a3f 100644 --- a/tests/test_datamatrix.py +++ b/tests/test_datamatrix.py @@ -123,3 +123,10 @@ def test_random_messages(self): msg = ''.join(random.choices(ASCII, k=n)) datamatrix = put.DataMatrix(msg) self.assertTrue(len(datamatrix.matrix) > 0) + + +if __name__ == '__main__': + # This enables running the unit tests by running this script which is + # much more convenient than 'python setup.py test' while developing tests. + # Note: package-under-test needs to be in python-path + unittest.main()