Beit-Hatfutsot / mojp-dbs-pipelines

pipelines for data sync of Jewish data sources to the DB of the muesum of the Jewish people
MIT License
0 stars 2 forks source link

'py.test' and 'make test' don't return the same result #44

Open Libisch opened 6 years ago

Libisch commented 6 years ago

When running tests, make test fails, while py.test tests/... passes.

Reproduce: in clearmash/api.py:

tests/test_clearmash_api.py .

================================================== 5 tests deselected ================================================== ======================================== 1 passed, 5 deselected in 0.37 seconds ========================================


2. Run ` $ make install` and then ` $ make test`
**Expected:**
16 passed
**Actual:**
1 failed (test_get_related_docs_of_item)

======================================================= FAILURES ======================================================= ____ test_get_related_docs_ofitem ____

def test_get_related_docs_of_item():
    fields = ['_c6_beit_hatfutsot_bh_base_template_family_name',
            '_c6_beit_hatfutsot_bh_base_template_multimedia_movies',
            '_c6_beit_hatfutsot_bh_base_template_multimedia_music',
            '_c6_beit_hatfutsot_bh_base_template_multimedia_photos',
            '_c6_beit_hatfutsot_bh_base_template_related_exhibition',
            '_c6_beit_hatfutsot_bh_base_template_related_musictext',
            '_c6_beit_hatfutsot_bh_base_template_related_personality',
            '_c6_beit_hatfutsot_bh_base_template_related_place',
            '_c6_beit_hatfutsot_bh_base_template_related_recieve_unit',
            '_c6_beit_hatfutsot_bh_base_template_source',
            '_c6_beit_hatfutsot_bh_place_located_in',
            '_c6_beit_hatfutsot_bh_place_locations',
            '_c6_beit_hatfutsot_bh_place_personality_birth',
            '_c6_beit_hatfutsot_bh_place_personality_death']
  related = [MockClearmashApi().get_document_related_docs_by_fields(220590, field) for field in fields]

tests/test_clearmash_api.py:174:


tests/test_clearmash_api.py:174: in related = [MockClearmashApi().get_document_related_docs_by_fields(220590, field) for field in fields] datapackage_pipelines_mojp/clearmash/api.py:75: in get_document_related_docs_by_fields return self._wcm_api_call("/Document/ByRelationField", {"EntityId": entity_id, "FieldId": field, "MaxNestingDepth": max_nesting_depth}) datapackage_pipelines_mojp/clearmash/api.py:80: in _wcm_api_call post_data=post_data) tests/test_clearmash_api.py:53: in _get_request_json res = self._get_mock_url_request_json(filename, get_res) tests/test_clearmash_api.py:25: in _get_mock_url_request_json return json.load(f) /usr/local/Cellar/python3/3.6.1/Frameworks/Python.framework/Versions/3.6/lib/python3.6/json/init.py:296: in load return loads(fp.read(),


self = <encodings.ascii.IncrementalDecoder object at 0x1060e0828> input = b'{\n\t"Entities": [\n\t\t{\n\t\t\t"Acl": "None",\n\t\t\t"Changeset": 4793755,\n\t\t\t"Document": {\n\t\t\t\t"Fields_B...\xd7\x99\xd7\x95\xd7\xa7\xd7\x9f, \xd7\xa4\xd7\x95\xd7\xa8\xd7\x98\xd7\xa8\xd7\x98"\n\t\t\t\t}\n\t\t\t]\n\t\t}\n\t]\n}' final = True

def decode(self, input, final=False):
  return codecs.ascii_decode(input, self.errors)[0]

E UnicodeDecodeError: 'ascii' codec can't decode byte 0xd7 in position 10417: ordinal not in range(128)

.tox/python/lib/python3.6/encodings/ascii.py:26: UnicodeDecodeError ========================================= 1 failed, 15 passed in 2.54 seconds ========================================== ERROR: InvocationError: '/Users/libi/mojp-dbs-pipelines/.tox/python/bin/py.test -s' ___ summary ____ ERROR: python: commands failed make: *** [test] Error 1

Libisch commented 6 years ago

@OriHoch