From 4a84a3088fc653e390eac5f5572d0d21a697d86f Mon Sep 17 00:00:00 2001 From: Leonard Richardson Date: Mon, 3 Jun 2013 07:36:13 -0400 Subject: Test that the filename warning isn't given unless the file actually exists on disk. --- bs4/tests/test_soup.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'bs4/tests/test_soup.py') diff --git a/bs4/tests/test_soup.py b/bs4/tests/test_soup.py index 860b17b..6219b89 100644 --- a/bs4/tests/test_soup.py +++ b/bs4/tests/test_soup.py @@ -81,6 +81,11 @@ class TestWarnings(SoupTest): finally: filehandle.close() + # The file no longer exists, so Beautiful Soup will no longer issue the warning. + with warnings.catch_warnings(record=True) as w: + soup = self.soup(filename) + self.assertEqual(0, len(w)) + def test_url_warning(self): with warnings.catch_warnings(record=True) as w: soup = self.soup("http://www.crummy.com/") -- cgit v1.2.3