Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TemplateTestCaseA.test_orientation fails #676

Open
mcepl opened this issue Oct 13, 2021 · 0 comments
Open

TemplateTestCaseA.test_orientation fails #676

mcepl opened this issue Oct 13, 2021 · 0 comments

Comments

@mcepl
Copy link

mcepl commented Oct 13, 2021

While packaging this package for openSUSE, I have this one test fail with Python 3.6.15 with DJANGO_SETTINGS_MODULE set to tests.settings.imagemagick:

[   59s] + DJANGO_SETTINGS_MODULE=tests.settings.imagemagick
[   59s] + PYTHONPATH=.:/home/abuild/rpmbuild/BUILDROOT/python-sorl-thumbnail-12.7.0-0.x86_64/usr/lib/python3.6/site-packages
[   59s] + PYTHONDONTWRITEBYTECODE=1
[   59s] + pytest-3.6 --ignore=_build.python36 --ignore=_build.python39 --ignore=_build.python38 -v -rs -k 'not TemplateTestCaseB and not test_image_file_deserialize'
[   60s] ============================= test session starts ==============================
[   60s] platform linux -- Python 3.6.15, pytest-6.2.5, py-1.10.0, pluggy-0.13.1 -- /usr/bin/python3.6
[   60s] cachedir: .pytest_cache
[   60s] django: settings: tests.settings.imagemagick (from env)
[   60s] rootdir: /home/abuild/rpmbuild/BUILD/sorl-thumbnail-12.7.0, configfile: setup.cfg, testpaths: tests
[   60s] plugins: django-4.1.0
[   60s] collecting ... collected 76 items / 4 deselected / 72 selected

[ ... plenty of passing and skipped tests ... ]

[   65s] =================================== FAILURES ===================================
[   65s] ______________________ TemplateTestCaseA.test_orientation ______________________
[   65s]
[   65s] self = <tests.thumbnail_tests.test_templatetags.TemplateTestCaseA testMethod=test_orientation>
[   65s]
[   65s]     def test_orientation(self):
[   65s]         ref = Image.open(os.path.join(DATA_DIR, '1_topleft.jpg'))
[   65s]         top = ref.getpixel((14, 7))
[   65s]         left = ref.getpixel((7, 14))
[   65s]         engine = PILEngine()
[   65s]
[   65s]         def epsilon(x, y):
[   65s]             if isinstance(x, (tuple, list)):
[   65s]                 x = sum(x) / len(x)
[   65s]             if isinstance(y, (tuple, list)):
[   65s]                 y = sum(y) / len(y)
[   65s]             return abs(x - y)
[   65s]
[   65s]         data_images = (
[   65s]             '1_topleft.jpg',
[   65s]             '2_topright.jpg',
[   65s]             '3_bottomright.jpg',
[   65s]             '4_bottomleft.jpg',
[   65s]             '5_lefttop.jpg',
[   65s]             '6_righttop.jpg',
[   65s]             '7_rightbottom.jpg',
[   65s]             '8_leftbottom.jpg'
[   65s]         )
[   65s]
[   65s]         for name in data_images:
[   65s]             th = self.BACKEND.get_thumbnail('data/%s' % name, '30x30')
[   65s]             im = engine.get_image(th)
[   65s]
[   65s]             self.assertLess(epsilon(top, im.getpixel((14, 7))), 10)
[   65s] >           self.assertLess(epsilon(left, im.getpixel((7, 14))), 10)
[   65s] E           AssertionError: 62 not less than 10
[   65s]
[   65s] tests/thumbnail_tests/test_templatetags.py:110: AssertionError
[   65s] ------------------------------ Captured log call -------------------------------
[   65s] DEBUG    slog:storage.py:49 exists: test/cache/c9/9a/c99a5bdaa10e2eb83215159fdd429d67.jpg
[   65s] DEBUG    slog:storage.py:25 open: data/1_topleft.jpg
[   65s] DEBUG    slog:storage.py:29 save: test/cache/c9/9a/c99a5bdaa10e2eb83215159fdd429d67.jpg
[   65s] DEBUG    slog:storage.py:37 get_available_name: test/cache/c9/9a/c99a5bdaa10e2eb83215159fdd429d67.jpg
[   65s] DEBUG    slog:storage.py:49 exists: test/cache/c9/9a/c99a5bdaa10e2eb83215159fdd429d67.jpg
[   65s] DEBUG    slog:storage.py:25 open: test/cache/c9/9a/c99a5bdaa10e2eb83215159fdd429d67.jpg
[   65s] =============================== warnings summary ===============================
[   65s] tests/thumbnail_tests/test_templatetags.py::TemplateTestCaseClient::test_empty_error
[   65s]   /home/abuild/rpmbuild/BUILD/sorl-thumbnail-12.7.0/tests/thumbnail_tests/urls.py:10: RemovedInDjango40Warning: django.conf.urls.url() is deprecated in favor of django.urls.re_path().
[   65s]     {'document_root': settings.MEDIA_ROOT, 'show_indexes': True}),
[   65s]
[   65s] tests/thumbnail_tests/test_templatetags.py::TemplateTestCaseClient::test_empty_error
[   65s]   /home/abuild/rpmbuild/BUILD/sorl-thumbnail-12.7.0/tests/thumbnail_tests/urls.py:11: RemovedInDjango40Warning: django.conf.urls.url() is deprecated in favor of django.urls.re_path().
[   65s]     url(r'^(.*\.html)$', direct_to_template),
[   65s]
[   65s] -- Docs: https://docs.pytest.org/en/stable/warnings.html
[   65s] =========================== short test summary info ============================
[   65s] SKIPPED [1] tests/thumbnail_tests/test_engines.py:240: RGBA is only supported in PIL
[   65s] SKIPPED [1] tests/thumbnail_tests/test_engines.py:373: the other engines fail this test
[   65s] SKIPPED [1] tests/thumbnail_tests/test_engines.py:347: the other engines fail this test
[   65s] SKIPPED [1] tests/thumbnail_tests/test_engines.py:589: See issue #427. This seems to not-fail with wand
[   65s] SKIPPED [1] tests/thumbnail_tests/test_engines.py:576: See issue #427
[   65s] ====== 1 failed, 66 passed, 5 skipped, 4 deselected, 2 warnings in 5.24s =======

Any idea, what's going on, please?

Complete logs with detailed information about all packages used and steps taken.

bmwiedemann pushed a commit to bmwiedemann/openSUSE that referenced this issue Oct 13, 2021
https://build.opensuse.org/request/show/925047
by user mcepl + dimstar_suse
- Skip test_orientation with
  DJANGO_SETTINGS_MODULE=tests.settings.imagemagick
  (gh#jazzband/sorl-thumbnail#676).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant