diff --git a/tests/test_article_only.py b/tests/test_article_only.py index 87e623c..5d5b813 100644 --- a/tests/test_article_only.py +++ b/tests/test_article_only.py @@ -9,7 +9,9 @@ SAMPLES = os.path.join(os.path.dirname(__file__), 'samples') def load_sample(filename): """Helper to get the content out of the sample files""" - return open(os.path.join(SAMPLES, filename)).read() + with open(os.path.join(SAMPLES, filename)) as f: + html = f.read() + return html class TestArticleOnly(unittest.TestCase):