diff options
author | Leonard Richardson <leonard.richardson@canonical.com> | 2013-06-03 07:36:13 -0400 |
---|---|---|
committer | Leonard Richardson <leonard.richardson@canonical.com> | 2013-06-03 07:36:13 -0400 |
commit | 4a84a3088fc653e390eac5f5572d0d21a697d86f (patch) | |
tree | d1bd10c0e79142b2b4c615c04b61c5e069320677 /bs4/tests/test_soup.py | |
parent | 9949d66d18f14623adf57fb4cef41b0282bb8672 (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.py | 5 |
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/") |