diff options
author | Leonard Richardson <leonardr@segfault.org> | 2023-01-31 11:54:48 -0500 |
---|---|---|
committer | Leonard Richardson <leonardr@segfault.org> | 2023-01-31 11:54:48 -0500 |
commit | ce05e066722c926b6cd6536968911072e5cf08b0 (patch) | |
tree | 540c24e3cde04fda2e0ba25fea9be7badd7e0538 /bs4/tests/test_pageelement.py | |
parent | 0cdcc79fb1332d6f7ac2b085ec654adfef50ac86 (diff) |
Consistently use pytest.mark.skipif to skip tests when the corresponding libraries are not installed.
Diffstat (limited to 'bs4/tests/test_pageelement.py')
-rw-r--r-- | bs4/tests/test_pageelement.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/bs4/tests/test_pageelement.py b/bs4/tests/test_pageelement.py index 75bab04..44c0c45 100644 --- a/bs4/tests/test_pageelement.py +++ b/bs4/tests/test_pageelement.py @@ -3,15 +3,15 @@ import copy import pickle import pytest -from soupsieve import SelectorSyntaxError - from bs4 import BeautifulSoup from bs4.element import ( Comment, SoupStrainer, ) -from . import SoupTest - +from . import ( + SoupTest, + SOUP_SIEVE_PRESENT, +) class TestEncoding(SoupTest): """Test the ability to encode objects into strings.""" @@ -213,6 +213,7 @@ class TestFormatters(SoupTest): assert soup.contents[0].name == 'pre' +@pytest.mark.skipif(not SOUP_SIEVE_PRESENT, reason="Soup Sieve not installed") class TestCSSSelectors(SoupTest): """Test basic CSS selector functionality. |