diff --git a/setup.cfg b/setup.cfg index e3cca47..8b0a3bc 100644 --- a/setup.cfg +++ b/setup.cfg @@ -14,22 +14,22 @@ license = MIT license_files = LICENSE.txt classifiers = - Development Status :: 4 - Beta - Intended Audience :: Developers - License :: OSI Approved :: MIT License - Programming Language :: Python :: 3 - Programming Language :: Python :: 3.6 - Programming Language :: Python :: 3.7 - Programming Language :: Python :: 3.8 - Programming Language :: Python :: 3.9 - Programming Language :: Python :: 3.10 - Programming Language :: Python :: 3.11 - Programming Language :: Python :: 3.12 - Topic :: Communications :: Email - Topic :: Text Processing :: Markup :: HTML + Development Status :: 4 - Beta + Intended Audience :: Developers + License :: OSI Approved :: MIT License + Programming Language :: Python :: 3 + Programming Language :: Python :: 3.6 + Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 + Programming Language :: Python :: 3.9 + Programming Language :: Python :: 3.10 + Programming Language :: Python :: 3.11 + Programming Language :: Python :: 3.12 + Topic :: Communications :: Email + Topic :: Text Processing :: Markup :: HTML project_urls = - Code = https://github.com/FelixSchwarz/mjml-python - Issue tracker = https://github.com/FelixSchwarz/mjml-python/issues + Code = https://github.com/FelixSchwarz/mjml-python + Issue tracker = https://github.com/FelixSchwarz/mjml-python/issues [options] @@ -46,7 +46,7 @@ install_requires = jinja2 scripts = - mjml/scripts/mjml-html-compare + mjml/scripts/mjml-html-compare [options.packages.find] @@ -55,12 +55,12 @@ exclude = [options.extras_require] testing = - FakeFSHelpers - HTMLCompare >= 0.3.0 # >= 0.3.0: ability to ignore attribute ordering in HTML - lxml - pytest + HTMLCompare >= 0.3.0 # >= 0.3.0: ability to ignore attribute ordering in HTML + lxml + pytest css_inlining = - css_inline >= 0.11, < 0.14 # >= 0.11, < 0.14: CSSInliner(inline_style_tags=..., keep_link_tags=..., keep_style_tags=...) + # >= 0.11: CSSInliner(inline_style_tags=..., keep_link_tags=..., keep_style_tags=...) + css_inline >= 0.11 [options.entry_points] diff --git a/tests/includes_with_umlauts_test.py b/tests/includes_with_umlauts_test.py index e97bd29..4edc97d 100644 --- a/tests/includes_with_umlauts_test.py +++ b/tests/includes_with_umlauts_test.py @@ -1,20 +1,24 @@ +import os +from contextlib import contextmanager from io import StringIO -import pytest -from schwarz.fakefs_helpers import FakeFS - from mjml import mjml_to_html -@pytest.fixture -def fs(): - _fs = FakeFS.set_up() - yield _fs - _fs.tear_down() +# could use "contextlib.chdir" in Python 3.11+ +# https://github.com/python/cpython/commit/3592980f9122ab0d9ed93711347742d110b749c2 +@contextmanager +def chdir(path): + old_chdir = os.getcwd() + try: + os.chdir(path) + yield + finally: + os.chdir(old_chdir) -def test_can_properly_handle_include_umlauts(fs): +def test_can_properly_handle_include_umlauts(tmp_path): included_mjml = ( '' ' ' @@ -30,9 +34,11 @@ def test_can_properly_handle_include_umlauts(fs): ' ' '' ) - fs.create_file('footer.mjml', contents=included_mjml.encode('utf8')) + path_footer = tmp_path / 'footer.mjml' + path_footer.write_text(included_mjml, encoding='utf8') - result = mjml_to_html(StringIO(mjml)) + with chdir(tmp_path): + result = mjml_to_html(StringIO(mjml)) html = result.html assert ('äöüß' in html)