diff --git a/tests/conftest.py b/tests/conftest.py index ae40096..c9ab549 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -40,7 +40,7 @@ def app(): @pytest.fixture() -def stable_langdetect(app): +def _stable_langdetect(app): """Ensure that ``langdetect`` always returns the same thing. See: https://github.com/Mimino666/langdetect#basic-usage. diff --git a/tests/test_hep_bd2xx.py b/tests/test_hep_bd2xx.py index c5bbd57..63c26a6 100644 --- a/tests/test_hep_bd2xx.py +++ b/tests/test_hep_bd2xx.py @@ -22,6 +22,7 @@ from __future__ import absolute_import, division, print_function +import pytest from dojson.contrib.marc21.utils import create_record from inspire_schemas.api import load_schema, validate @@ -175,8 +176,8 @@ def test_titles_from_245__a_b(): assert expected == result['245'] - -def test_title_translations_from_242__a(stable_langdetect): +@pytest.mark.usefixtures(name='_stable_langdetect') +def test_title_translations_from_242__a(): schema = load_schema('hep') subschema = schema['properties']['title_translations'] @@ -206,8 +207,8 @@ def test_title_translations_from_242__a(stable_langdetect): assert expected == result['242'] - -def test_title_translations_from_242__a_b(stable_langdetect): +@pytest.mark.usefixtures(name='_stable_langdetect') +def test_title_translations_from_242__a_b(): schema = load_schema('hep') subschema = schema['properties']['title_translations'] diff --git a/tests/test_hep_bd5xx.py b/tests/test_hep_bd5xx.py index b7cf13c..39701ef 100644 --- a/tests/test_hep_bd5xx.py +++ b/tests/test_hep_bd5xx.py @@ -325,7 +325,7 @@ def test_thesis_info_defense_date_from_500__a_incomplete_human_date(): result = hep.do(create_record(snippet)) assert validate(result['thesis_info'], subschema) is None - expected == result['thesis_info'] + assert expected == result['thesis_info'] expected = [ {'a': 'Presented on 1992-12'},