conftest.py 788 B

123456789101112131415161718192021
  1. from __future__ import unicode_literals
  2. import pytest
  3. import html5lib
  4. html = '''<p>Return a truncated copy of the string. The length is specified
  5. with the first parameter which defaults to <tt class="docutils literal">
  6. <span class="pre">255</span></tt>. If the second parameter is
  7. <tt class="docutils literal"><span class="pre">true</span></tt> the filter
  8. will cut the text at length. Otherwise it will discard the last word. If
  9. the text was in fact truncated it will append an ellipsis sign
  10. (<tt class="docutils literal"><span class="pre">"..."</span></tt>). If you
  11. want a different ellipsis sign than <tt class="docutils literal">
  12. <span class="pre">"..."</span></tt> you can specify it using the third
  13. parameter.</p>'''
  14. @pytest.fixture
  15. def etree():
  16. return html5lib.parse(html)