summaryrefslogtreecommitdiff
path: root/bs4/tests/test_soup.py
diff options
context:
space:
mode:
authorLeonard Richardson <leonard.richardson@canonical.com>2013-06-03 07:36:13 -0400
committerLeonard Richardson <leonard.richardson@canonical.com>2013-06-03 07:36:13 -0400
commit4a84a3088fc653e390eac5f5572d0d21a697d86f (patch)
treed1bd10c0e79142b2b4c615c04b61c5e069320677 /bs4/tests/test_soup.py
parent9949d66d18f14623adf57fb4cef41b0282bb8672 (diff)
Test that the filename warning isn't given unless the file actually exists on disk.
Diffstat (limited to 'bs4/tests/test_soup.py')
-rw-r--r--bs4/tests/test_soup.py5
1 files changed, 5 insertions, 0 deletions
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/")