From d036c12a0768652be8aa25c3e6cc9fc28ab31664 Mon Sep 17 00:00:00 2001 From: John Evans Date: Thu, 15 Aug 2013 17:10:41 -0400 Subject: [PATCH] Handles testing gracefully when PIL not present. If PIL is not present, certain writing tests should not be run. These tests would show up as errors instead. Closes #102. --- glymur/test/fixtures.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/glymur/test/fixtures.py b/glymur/test/fixtures.py index ad4fe6d..1c196fb 100644 --- a/glymur/test/fixtures.py +++ b/glymur/test/fixtures.py @@ -29,6 +29,12 @@ NO_READ_BACKEND_MSG += "order to run the tests in this suite." try: from matplotlib.pyplot import imread + + # The whole point of trying to import PIL is to determine if it's there + # or not. We won't use it directly. + # pylint: disable=F0401,W0611 + import PIL + NO_READ_BACKEND = False except ImportError: NO_READ_BACKEND = True