mirror of
https://git.anonymousland.org/anonymousland/synapse.git
synced 2025-05-04 14:44:57 -04:00
Skip unit tests which require optional dependencies (#9031)
If we are lacking an optional dependency, skip the tests that rely on it.
This commit is contained in:
parent
eee3c3c52f
commit
8d3d264052
7 changed files with 91 additions and 14 deletions
|
@ -20,8 +20,16 @@ from synapse.rest.media.v1.preview_url_resource import (
|
|||
|
||||
from . import unittest
|
||||
|
||||
try:
|
||||
import lxml
|
||||
except ImportError:
|
||||
lxml = None
|
||||
|
||||
|
||||
class PreviewTestCase(unittest.TestCase):
|
||||
if not lxml:
|
||||
skip = "url preview feature requires lxml"
|
||||
|
||||
def test_long_summarize(self):
|
||||
example_paras = [
|
||||
"""Tromsø (Norwegian pronunciation: [ˈtrʊmsœ] ( listen); Northern Sami:
|
||||
|
@ -137,6 +145,9 @@ class PreviewTestCase(unittest.TestCase):
|
|||
|
||||
|
||||
class PreviewUrlTestCase(unittest.TestCase):
|
||||
if not lxml:
|
||||
skip = "url preview feature requires lxml"
|
||||
|
||||
def test_simple(self):
|
||||
html = """
|
||||
<html>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue