Test unit.common.test_utils.test_latin_str_to_unicode failed if you try run in with covearge

Bug #1525277 reported by Tatyanka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Fuel for OpenStack
Fix Committed
Medium
Nikita Zubkov
Mitaka
Won't Fix
Medium
Fuel Python (Deprecated)
Newton
Fix Committed
Medium
Nikita Zubkov

Bug Description

If you run tests with coverage, test fuelclient.tests.unit.common.test_utils.TestUtils.test_latin_str_to_unicode fail
FAIL: fuelclient.tests.unit.common.test_utils.TestUtils.test_latin_str_to_unicode
tags: worker-0
----------------------------------------------------------------------
Empty attachments:
  pythonlogging:''
  stderr
  stdout

Traceback (most recent call last):
  File "/home/romcheg/projects/python-fuelclient/.tox/cover/local/lib/python2.7/site-packages/mock/mock.py", line 1305, in patched
    return func(*args, **keywargs)
  File "fuelclient/tests/unit/common/test_utils.py", line 240, in test_latin_str_to_unicode
    test_data = 'czegoś' if six.PY3 else u'czegoś'.encode('iso-8859-16')
  File "/home/romcheg/projects/python-fuelclient/.tox/cover/lib/python2.7/encodings/__init__.py", line 100, in search_function
    level=0)
  File "/home/romcheg/projects/python-fuelclient/.tox/cover/local/lib/python2.7/site-packages/coverage/control.py", line 587, in _should_trace
    disp = self._should_trace_internal(filename, frame)
  File "/home/romcheg/projects/python-fuelclient/.tox/cover/local/lib/python2.7/site-packages/coverage/control.py", line 489, in _should_trace_internal
    canonical = files.canonical_filename(filename)
  File "/home/romcheg/projects/python-fuelclient/.tox/cover/local/lib/python2.7/site-packages/coverage/files.py", line 69, in canonical_filename
    cf = abs_file(filename)
  File "/home/romcheg/projects/python-fuelclient/.tox/cover/local/lib/python2.7/site-packages/coverage/files.py", line 152, in abs_file
    path = unicode_filename(path)
  File "/home/romcheg/projects/python-fuelclient/.tox/cover/local/lib/python2.7/site-packages/coverage/files.py", line 137, in unicode_filename
    filename = filename.decode(encoding, "replace")
LookupError: unknown encoding: iso-8859-16
Ran 327 tests in 4.665s (+0.031s)
FAILED (id=26, failures=1)
error: testr failed (1)
ERROR: InvocationError: '/bin/bash -c TESTS_DIR=./fuelclient/tests/unit python setup.py testr --coverage'

Changed in fuel:
status: New → Confirmed
importance: Undecided → Medium
tags: added: module-client
Dmitry Pyzhov (dpyzhov)
tags: added: tech-debt
Changed in fuel:
milestone: 8.0 → 9.0
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-fuelclient (master)

Fix proposed to branch: master
Review: https://review.openstack.org/310867

Changed in fuel:
assignee: Fuel Python (Deprecated) (fuel-python) → Nikita Zubkov (zubchick)
status: Confirmed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-fuelclient (master)

Reviewed: https://review.openstack.org/310867
Committed: https://git.openstack.org/cgit/openstack/python-fuelclient/commit/?id=261c8b0731618f982787faa31f0e5eac5a6c640f
Submitter: Jenkins
Branch: master

commit 261c8b0731618f982787faa31f0e5eac5a6c640f
Author: Nikita Zubkov <email address hidden>
Date: Thu Apr 28 20:07:55 2016 +0300

    Fix tests with coverage

    Mocking global sys.getfilesystemencoding affects coverage too. This
    patch mocks sys only for utils module.

    Change-Id: I0bd383be5de3c34a606a3c5e1d49fadd1178e070
    Closes-Bug: #1525277

Changed in fuel:
status: In Progress → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.