summary refs log tree commit diff
path: root/tests/test_preview.py
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2021-01-07 13:04:45 +0000
committerErik Johnston <erik@matrix.org>2021-01-07 13:04:45 +0000
commit82a91208d6a9fd3038e1ec4ddcc62cbe359f2a6b (patch)
tree4bc3e65a85fd5ea886128e0a5a96e0ce8872a8bb /tests/test_preview.py
parentMerge remote-tracking branch 'origin/develop' into matrix-org-hotfixes (diff)
parentImprove the performance of calculating ignored users in large rooms (#9024) (diff)
downloadsynapse-82a91208d6a9fd3038e1ec4ddcc62cbe359f2a6b.tar.xz
Merge remote-tracking branch 'origin/develop' into matrix-org-hotfixes
Diffstat (limited to 'tests/test_preview.py')
-rw-r--r--tests/test_preview.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/tests/test_preview.py b/tests/test_preview.py

index a883d707df..c19facc1cb 100644 --- a/tests/test_preview.py +++ b/tests/test_preview.py
@@ -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>