From 74796c42da83d2bf1baf6f1dfad1c5711b64915f Mon Sep 17 00:00:00 2001 From: Florian Pagnoux Date: Fri, 19 Apr 2019 02:02:50 -0400 Subject: [PATCH] Remove nose --- README.md | 4 +- setup.cfg | 5 -- setup.py | 4 +- .../test_fancy_indexing.py | 49 +++++++------------ tests/core/test_extensions.py | 6 +-- tests/core/test_formula_helpers.py | 10 ++-- tests/core/test_parameters.py | 33 +++++-------- tests/core/test_yaml.py | 11 ++--- tests/web_api/test_entities.py | 32 ++++++------ tests/web_api/test_parameters.py | 48 +++++++++--------- tests/web_api/test_spec.py | 14 +++--- tests/web_api/test_trace.py | 5 +- tests/web_api/test_variables.py | 36 ++++++-------- 13 files changed, 105 insertions(+), 152 deletions(-) diff --git a/README.md b/README.md index 464d683773..59fef7e37b 100644 --- a/README.md +++ b/README.md @@ -42,13 +42,13 @@ make test To run all the tests defined on a test file: ```sh -nosetests core/test_parameters.py +pytest tests/core/test_parameters.py ``` To run a single test: ```sh -nosetests core/test_parameters.py:test_parameter_for_period +pytest tests/core/test_parameters.py -k test_parameter_for_period ``` ## Style diff --git a/setup.cfg b/setup.cfg index 7395f45d3a..f8cb839bec 100644 --- a/setup.cfg +++ b/setup.cfg @@ -13,11 +13,6 @@ hang-closing = true ignore = E128,E251,F403,F405,E501,W503,W504 in-place = true -[nosetests] -where = tests -exe = true -with-doctest = true - [tool:pytest] addopts = --showlocals --doctest-modules --disable-pytest-warnings testpaths = tests diff --git a/setup.py b/setup.py index 8b196e0003..20ab0ba265 100644 --- a/setup.py +++ b/setup.py @@ -10,7 +10,7 @@ general_requirements = [ 'dpath == 1.4.0', 'enum34 >= 1.1.6', - 'nose < 2.0.0', # For openfisca test + 'pytest >= 4.0.0, < 5.0.0', # For openfisca test 'numpy >= 1.11, < 1.16', 'psutil == 5.4.6', 'PyYAML >= 3.10', @@ -29,7 +29,6 @@ 'flake8 >= 3.7.0, < 3.8.0', 'flake8-bugbear >= 19.3.0, < 20.0.0', 'flake8-print >= 3.1.0, < 4.0.0', - 'pytest >= 4.0.0, < 5.0.0', 'pytest-cov >= 2.0.0, < 3.0.0', 'openfisca-country-template >= 3.6.0rc0, < 4.0.0', 'openfisca-extension-template >= 1.2.0rc0, < 2.0.0' @@ -75,5 +74,4 @@ ], }, packages = find_packages(exclude=['tests*']), - test_suite = 'nose.collector', ) diff --git a/tests/core/parameters_fancy_indexing/test_fancy_indexing.py b/tests/core/parameters_fancy_indexing/test_fancy_indexing.py index 0006b135da..d34eb00773 100644 --- a/tests/core/parameters_fancy_indexing/test_fancy_indexing.py +++ b/tests/core/parameters_fancy_indexing/test_fancy_indexing.py @@ -1,9 +1,11 @@ # -*- coding: utf-8 -*- import os +import re import numpy as np -from nose.tools import raises, assert_in, assert_regexp_matches +import pytest + from openfisca_core.tools import assert_near from openfisca_core.parameters import ParameterNode, Parameter, ParameterNotFound @@ -55,17 +57,13 @@ def test_triple_fancy_indexing(): assert_near(P[family_status][housing_occupancy_status][zone], [100, 200, 300, 400, 500, 600, 700, 800]) -@raises(ParameterNotFound) def test_wrong_key(): zone = np.asarray(['z1', 'z2', 'z2', 'toto']) - try: + with pytest.raises(ParameterNotFound) as e: P.single.owner[zone] - except ParameterNotFound as e: - assert_in("'rate.single.owner.toto' was not found", get_message(e)) - raise + assert "'rate.single.owner.toto' was not found" in get_message(e.value) -@raises(ValueError) def test_inhomogenous(): parameters = ParameterNode(directory_path = LOCAL_DIR) parameters.rate.couple.owner.add_child('toto', Parameter('toto', { @@ -78,15 +76,12 @@ def test_inhomogenous(): P = parameters.rate('2015-01-01') housing_occupancy_status = np.asarray(['owner', 'owner', 'tenant', 'tenant']) - try: + with pytest.raises(ValueError) as error: P.couple[housing_occupancy_status] - except ValueError as e: - assert_in("'rate.couple.owner.toto' exists", get_message(e)) - assert_in("'rate.couple.tenant.toto' doesn't", get_message(e)) - raise + assert "'rate.couple.owner.toto' exists" in get_message(error.value) + assert "'rate.couple.tenant.toto' doesn't" in get_message(error.value) -@raises(ValueError) def test_inhomogenous_2(): parameters = ParameterNode(directory_path = LOCAL_DIR) parameters.rate.couple.tenant.add_child('toto', Parameter('toto', { @@ -99,15 +94,12 @@ def test_inhomogenous_2(): P = parameters.rate('2015-01-01') housing_occupancy_status = np.asarray(['owner', 'owner', 'tenant', 'tenant']) - try: + with pytest.raises(ValueError) as e: P.couple[housing_occupancy_status] - except ValueError as e: - assert_in("'rate.couple.tenant.toto' exists", get_message(e)) - assert_in("'rate.couple.owner.toto' doesn't", get_message(e)) - raise + assert "'rate.couple.tenant.toto' exists" in get_message(e.value) + assert "'rate.couple.owner.toto' doesn't" in get_message(e.value) -@raises(ValueError) def test_inhomogenous_3(): parameters = ParameterNode(directory_path = LOCAL_DIR) parameters.rate.couple.tenant.add_child('z4', ParameterNode('toto', data = { @@ -121,12 +113,10 @@ def test_inhomogenous_3(): P = parameters.rate('2015-01-01') zone = np.asarray(['z1', 'z2', 'z2', 'z1']) - try: + with pytest.raises(ValueError) as e: P.couple.tenant[zone] - except ValueError as e: - assert_in("'rate.couple.tenant.z4' is a node", get_message(e)) - assert_regexp_matches(get_message(e), r"'rate.couple.tenant.z(1|2|3)' is not") - raise + assert "'rate.couple.tenant.z4' is a node" in get_message(e.value) + assert re.findall(r"'rate.couple.tenant.z(1|2|3)' is not", get_message(e.value)) P_2 = parameters.local_tax('2015-01-01') @@ -140,15 +130,12 @@ def test_with_properties_starting_by_number(): P_3 = parameters.bareme('2015-01-01') -@raises(NotImplementedError) def test_with_bareme(): city_code = np.asarray(['75012', '75007', '75015']) - try: - P_3[city_code], [100, 300, 200] - except NotImplementedError as e: - assert_regexp_matches(get_message(e), r"'bareme.7501\d' is a 'MarginalRateTaxScale'") - assert_in("has not been implemented", get_message(e)) - raise + with pytest.raises(NotImplementedError) as e: + P_3[city_code] + assert re.findall(r"'bareme.7501\d' is a 'MarginalRateTaxScale'", get_message(e.value)) + assert "has not been implemented" in get_message(e.value) def test_with_enum(): diff --git a/tests/core/test_extensions.py b/tests/core/test_extensions.py index 6d6fa468c5..864adf606e 100644 --- a/tests/core/test_extensions.py +++ b/tests/core/test_extensions.py @@ -1,4 +1,4 @@ -from nose.tools import raises +import pytest from openfisca_country_template import CountryTaxBenefitSystem @@ -24,6 +24,6 @@ def test_access_to_parameters(): assert tbs.parameters.local_town.child_allowance.amount('2016-01') == 100.0 -@raises(ValueError) def test_failure_to_load_extension_when_directory_doesnt_exist(): - original_tbs.load_extension('/this/is/not/a/real/path') + with pytest.raises(ValueError): + original_tbs.load_extension('/this/is/not/a/real/path') diff --git a/tests/core/test_formula_helpers.py b/tests/core/test_formula_helpers.py index 3c90f7c9b0..51bc2a2e20 100644 --- a/tests/core/test_formula_helpers.py +++ b/tests/core/test_formula_helpers.py @@ -1,26 +1,26 @@ # -*- coding: utf-8 -*- import numpy -from nose.tools import raises +import pytest from openfisca_core.formula_helpers import apply_thresholds as apply_thresholds from openfisca_core.tools import assert_near -@raises(AssertionError) def test_apply_thresholds_with_too_many_thresholds(): input = numpy.array([10]) thresholds = [5, 4] choice_list = [10] - return apply_thresholds(input, thresholds, choice_list) + with pytest.raises(AssertionError): + return apply_thresholds(input, thresholds, choice_list) -@raises(AssertionError) def test_apply_thresholds_with_too_few_thresholds(): input = numpy.array([10]) thresholds = [5] choice_list = [10, 15, 20] - return apply_thresholds(input, thresholds, choice_list) + with pytest.raises(AssertionError): + return apply_thresholds(input, thresholds, choice_list) def test_apply_thresholds(): diff --git a/tests/core/test_parameters.py b/tests/core/test_parameters.py index c2beb59fef..88fedcabab 100644 --- a/tests/core/test_parameters.py +++ b/tests/core/test_parameters.py @@ -1,8 +1,9 @@ # -*- coding: utf-8 -*- -from nose.tools import assert_equal, raises import tempfile +import pytest + from openfisca_core.parameters import ParameterNotFound, ParameterNode, ParameterNodeAtInstant, load_parameter_file from .test_countries import tax_benefit_system @@ -25,35 +26,26 @@ def test_param_values(): } for date, value in dated_values.items(): - assert_equal( - tax_benefit_system.get_parameters_at_instant(date).taxes.income_tax_rate, - value - ) + assert tax_benefit_system.get_parameters_at_instant(date).taxes.income_tax_rate == value -@raises(ParameterNotFound) def test_param_before_it_is_defined(): - tax_benefit_system.get_parameters_at_instant('1997-12-31').taxes.income_tax_rate + with pytest.raises(ParameterNotFound): + tax_benefit_system.get_parameters_at_instant('1997-12-31').taxes.income_tax_rate # The placeholder should have no effect on the parameter computation def test_param_with_placeholder(): - assert_equal( - tax_benefit_system.get_parameters_at_instant('2018-01-01').taxes.income_tax_rate, - 0.15 - ) + assert tax_benefit_system.get_parameters_at_instant('2018-01-01').taxes.income_tax_rate == 0.15 def test_stopped_parameter_before_end_value(): - assert_equal( - tax_benefit_system.get_parameters_at_instant('2011-12-31').benefits.housing_allowance, - 0.25 - ) + assert tax_benefit_system.get_parameters_at_instant('2011-12-31').benefits.housing_allowance == 0.25 -@raises(ParameterNotFound) def test_stopped_parameter_after_end_value(): - tax_benefit_system.get_parameters_at_instant('2016-12-01').benefits.housing_allowance + with pytest.raises(ParameterNotFound): + tax_benefit_system.get_parameters_at_instant('2016-12-01').benefits.housing_allowance def test_parameter_for_period(): @@ -61,10 +53,10 @@ def test_parameter_for_period(): assert income_tax_rate("2015") == income_tax_rate("2015-01-01") -@raises(ValueError) def test_wrong_value(): income_tax_rate = tax_benefit_system.parameters.taxes.income_tax_rate - income_tax_rate("test") + with pytest.raises(ValueError): + income_tax_rate("test") def test_parameter_repr(): @@ -97,8 +89,7 @@ def test_parameter_node_metadata(): def test_parameter_documentation(): parameter = tax_benefit_system.parameters.benefits.housing_allowance - assert_equal(parameter.documentation, - 'A fraction of the rent.\nFrom the 1st of Dec 2016, the housing allowance no longer exists.\n') + assert parameter.documentation == 'A fraction of the rent.\nFrom the 1st of Dec 2016, the housing allowance no longer exists.\n' def test_get_descendants(): diff --git a/tests/core/test_yaml.py b/tests/core/test_yaml.py index 1514dfe92b..31fe74454b 100644 --- a/tests/core/test_yaml.py +++ b/tests/core/test_yaml.py @@ -4,7 +4,7 @@ import os import subprocess -from nose.tools import nottest, raises +import pytest import openfisca_extension_template from openfisca_core.tools.test_runner import run_tests @@ -18,11 +18,6 @@ EXIT_TESTSFAILED = 1 -# Declare that these two functions are not tests to run with nose -nottest(run_tests) - - -@nottest def run_yaml_test(path, options = None): yaml_path = os.path.join(yaml_tests_dir, path) @@ -92,12 +87,12 @@ def test_shell_script(): subprocess.check_call(command, stdout = devnull, stderr = devnull) -@raises(subprocess.CalledProcessError) def test_failing_shell_script(): yaml_path = os.path.join(yaml_tests_dir, 'test_failure.yaml') command = ['openfisca', 'test', yaml_path, '-c', 'openfisca_dummy_country'] with open(os.devnull, 'wb') as devnull: - subprocess.check_call(command, stdout = devnull, stderr = devnull) + with pytest.raises(subprocess.CalledProcessError): + subprocess.check_call(command, stdout = devnull, stderr = devnull) def test_shell_script_with_reform(): diff --git a/tests/web_api/test_entities.py b/tests/web_api/test_entities.py index 2bb57f166b..de5600599f 100644 --- a/tests/web_api/test_entities.py +++ b/tests/web_api/test_entities.py @@ -1,7 +1,6 @@ # -*- coding: utf-8 -*- from http.client import OK -from nose.tools import assert_equal import json import openfisca_country_template from . import subject @@ -19,22 +18,19 @@ def test_response_data(): entities = json.loads(entities_response.data.decode('utf-8')) test_documentation = openfisca_country_template.entities.Household.doc.strip() - assert_equal( - entities['household'], - { - 'description': 'All the people in a family or group who live together in the same place.', - 'documentation': test_documentation, - 'plural': 'households', - 'roles': { - 'child': { - 'description': 'Other individuals living in the household.', - 'plural': 'children', - }, - 'parent': { - 'description': 'The one or two adults in charge of the household.', - 'plural': 'parents', - 'max': 2, - } + assert entities['household'] == { + 'description': 'All the people in a family or group who live together in the same place.', + 'documentation': test_documentation, + 'plural': 'households', + 'roles': { + 'child': { + 'description': 'Other individuals living in the household.', + 'plural': 'children', + }, + 'parent': { + 'description': 'The one or two adults in charge of the household.', + 'plural': 'parents', + 'max': 2, } } - ) + } diff --git a/tests/web_api/test_parameters.py b/tests/web_api/test_parameters.py index a530729cb5..edee69d0c9 100644 --- a/tests/web_api/test_parameters.py +++ b/tests/web_api/test_parameters.py @@ -2,8 +2,9 @@ from http.client import OK, NOT_FOUND import json +import re + import pytest -from nose.tools import assert_equal, assert_regexp_matches, assert_in from . import subject # /parameters @@ -19,17 +20,11 @@ def test_return_code(): def test_response_data(): parameters = json.loads(parameters_response.data.decode('utf-8')) - assert_equal( - parameters['taxes.income_tax_rate'], - { - 'description': 'Income tax rate', - 'href': 'http://localhost/parameter/taxes/income_tax_rate' - } - ) - assert_equal( - parameters.get('taxes'), - None - ) + assert parameters['taxes.income_tax_rate'] == { + 'description': 'Income tax rate', + 'href': 'http://localhost/parameter/taxes/income_tax_rate' + } + assert parameters.get('taxes') is None # /parameter/ @@ -57,15 +52,17 @@ def test_parameter_values(): assert parameter['description'] == 'Income tax rate' assert parameter['values'] == {'2015-01-01': 0.15, '2014-01-01': 0.14, '2013-01-01': 0.13, '2012-01-01': 0.16} assert parameter['metadata'] == {'unit': '/1'} - assert_regexp_matches(parameter['source'], GITHUB_URL_REGEX) - assert_in('taxes/income_tax_rate.yaml', parameter['source']) + assert re.match(GITHUB_URL_REGEX, parameter['source']) + assert 'taxes/income_tax_rate.yaml' in parameter['source'] # 'documentation' attribute exists only when a value is defined response = subject.get('/parameter/benefits/housing_allowance') parameter = json.loads(response.data) assert sorted(list(parameter.keys())), ['description', 'documentation', 'id', 'metadata', 'source' == 'values'] - assert_equal(parameter['documentation'], - 'A fraction of the rent.\nFrom the 1st of Dec 2016, the housing allowance no longer exists.') + assert ( + parameter['documentation'] == + 'A fraction of the rent.\nFrom the 1st of Dec 2016, the housing allowance no longer exists.' + ) def test_parameter_node(): @@ -73,15 +70,16 @@ def test_parameter_node(): assert response.status_code == OK parameter = json.loads(response.data) assert sorted(list(parameter.keys())), ['description', 'documentation', 'id', 'metadata', 'source' == 'subparams'] - assert_equal(parameter['documentation'], - "Government support for the citizens and residents of society. " - "\nThey may be provided to people of any income level, as with social security, " - "\nbut usually it is intended to ensure that everyone can meet their basic human needs " - "\nsuch as food and shelter.\n(See https://en.wikipedia.org/wiki/Welfare)") - assert_equal(parameter['subparams'], { + assert parameter['documentation'] == ( + "Government support for the citizens and residents of society. " + "\nThey may be provided to people of any income level, as with social security, " + "\nbut usually it is intended to ensure that everyone can meet their basic human needs " + "\nsuch as food and shelter.\n(See https://en.wikipedia.org/wiki/Welfare)" + ) + assert parameter['subparams'] == { 'housing_allowance': {'description': 'Housing allowance amount (as a fraction of the rent)'}, 'basic_income': {'description': 'Amount of the basic income'} - }, parameter['subparams']) + }, parameter['subparams'] def test_stopped_parameter_values(): @@ -94,13 +92,13 @@ def test_scale(): response = subject.get('/parameter/taxes/social_security_contribution') parameter = json.loads(response.data) assert sorted(list(parameter.keys())), ['brackets', 'description', 'id', 'metadata' == 'source'] - assert_equal(parameter['brackets'], { + assert parameter['brackets'] == { '2013-01-01': {"0.0": 0.03, "12000.0": 0.10}, '2014-01-01': {"0.0": 0.03, "12100.0": 0.10}, '2015-01-01': {"0.0": 0.04, "12200.0": 0.12}, '2016-01-01': {"0.0": 0.04, "12300.0": 0.12}, '2017-01-01': {"0.0": 0.02, "6000.0": 0.06, "12400.0": 0.12}, - }) + } def check_code(route, code): diff --git a/tests/web_api/test_spec.py b/tests/web_api/test_spec.py index 5dc43da11c..dd59b588bd 100644 --- a/tests/web_api/test_spec.py +++ b/tests/web_api/test_spec.py @@ -4,8 +4,6 @@ from http.client import OK import dpath -from nose.tools import assert_in - from . import subject @@ -38,10 +36,10 @@ def test_paths(): def test_entity_definition(): - assert_in('parents', dpath.get(body, 'definitions/Household/properties')) - assert_in('children', dpath.get(body, 'definitions/Household/properties')) - assert_in('salary', dpath.get(body, 'definitions/Person/properties')) - assert_in('rent', dpath.get(body, 'definitions/Household/properties')) + assert 'parents' in dpath.get(body, 'definitions/Household/properties') + assert 'children' in dpath.get(body, 'definitions/Household/properties') + assert 'salary' in dpath.get(body, 'definitions/Person/properties') + assert 'rent' in dpath.get(body, 'definitions/Household/properties') assert 'number' == dpath.get(body, 'definitions/Person/properties/salary/additionalProperties/type') @@ -49,8 +47,8 @@ def test_situation_definition(): situation_input = body['definitions']['SituationInput'] situation_output = body['definitions']['SituationOutput'] for situation in situation_input, situation_output: - assert_in('households', dpath.get(situation, '/properties')) - assert_in('persons', dpath.get(situation, '/properties')) + assert 'households' in dpath.get(situation, '/properties') + assert 'persons' in dpath.get(situation, '/properties') assert "#/definitions/Household" == dpath.get(situation, '/properties/households/additionalProperties/$ref') assert "#/definitions/Person" == dpath.get(situation, '/properties/persons/additionalProperties/$ref') diff --git a/tests/web_api/test_trace.py b/tests/web_api/test_trace.py index 1a5081dab8..d6d47e9bed 100644 --- a/tests/web_api/test_trace.py +++ b/tests/web_api/test_trace.py @@ -3,7 +3,6 @@ import json from copy import deepcopy -from nose.tools import assert_is_instance from http.client import OK import dpath from openfisca_country_template.situation_examples import single, couple @@ -21,8 +20,8 @@ def test_trace_basic(): assert response.status_code == OK response_json = json.loads(response.data.decode('utf-8')) disposable_income_value = dpath.util.get(response_json, 'trace/disposable_income<2017-01>/value') - assert_is_instance(disposable_income_value, list) - assert_is_instance(disposable_income_value[0], float) + assert isinstance(disposable_income_value, list) + assert isinstance(disposable_income_value[0], float) disposable_income_dep = dpath.util.get(response_json, 'trace/disposable_income<2017-01>/dependencies') assert_items_equal( disposable_income_dep, diff --git a/tests/web_api/test_variables.py b/tests/web_api/test_variables.py index 90554d6624..3b44a98d6e 100644 --- a/tests/web_api/test_variables.py +++ b/tests/web_api/test_variables.py @@ -2,8 +2,9 @@ from http.client import OK, NOT_FOUND import json +import re + import pytest -from nose.tools import assert_equal, assert_regexp_matches, assert_in, assert_is_none, assert_not_in from . import subject @@ -23,13 +24,10 @@ def test_return_code(): def test_response_data(): variables = json.loads(variables_response.data.decode('utf-8')) - assert_equal( - variables['birth'], - { - 'description': 'Birth date', - 'href': 'http://localhost/variable/birth' - } - ) + assert variables['birth'] == { + 'description': 'Birth date', + 'href': 'http://localhost/variable/birth' + } # /variable/ @@ -65,7 +63,7 @@ def test_input_variable_value(expected_values): def test_input_variable_github_url(): - assert_regexp_matches(input_variable['source'], GITHUB_URL_REGEX) + assert re.match(GITHUB_URL_REGEX, input_variable['source']) variable_response = subject.get('/variable/income_tax') @@ -92,7 +90,7 @@ def test_variable_value(expected_values): def test_variable_formula_github_link(): - assert_regexp_matches(variable['formulas']['0001-01-01']['source'], GITHUB_URL_REGEX) + assert re.match(GITHUB_URL_REGEX, variable['formulas']['0001-01-01']['source']) def test_variable_formula_content(): @@ -103,15 +101,15 @@ def test_variable_formula_content(): def test_null_values_are_dropped(): variable_response = subject.get('/variable/age') variable = json.loads(variable_response.data.decode('utf-8')) - assert_not_in('references', variable.keys()) + assert 'references' not in variable.keys() def test_variable_with_start_and_stop_date(): response = subject.get('/variable/housing_allowance') variable = json.loads(response.data.decode('utf-8')) assert_items_equal(variable['formulas'], ['1980-01-01', '2016-12-01']) - assert_is_none(variable['formulas']['2016-12-01']) - assert_in('formula', variable['formulas']['1980-01-01']['content']) + assert variable['formulas']['2016-12-01'] is None + assert 'formula' in variable['formulas']['1980-01-01']['content'] def test_variable_with_enum(): @@ -119,12 +117,12 @@ def test_variable_with_enum(): variable = json.loads(response.data.decode('utf-8')) assert variable['valueType'] == 'String' assert variable['defaultValue'] == 'tenant' - assert_in('possibleValues', variable.keys()) - assert_equal(variable['possibleValues'], { + assert 'possibleValues' in variable.keys() + assert variable['possibleValues'] == { 'free_lodger': 'Free lodger', 'homeless': 'Homeless', 'owner': 'Owner', - 'tenant': 'Tenant'}) + 'tenant': 'Tenant'} dated_variable_response = subject.get('/variable/basic_income') @@ -157,8 +155,6 @@ def test_variable_encoding(): def test_variable_documentation(): response = subject.get('/variable/housing_allowance') variable = json.loads(response.data.decode('utf-8')) - assert_equal(variable['documentation'], - "This allowance was introduced on the 1st of Jan 1980.\nIt disappeared in Dec 2016.") + assert variable['documentation'] == "This allowance was introduced on the 1st of Jan 1980.\nIt disappeared in Dec 2016." - assert_equal(variable['formulas']['1980-01-01']['documentation'], - "\nTo compute this allowance, the 'rent' value must be provided for the same month, but 'housing_occupancy_status' is not necessary.\n") + assert variable['formulas']['1980-01-01']['documentation'] == "\nTo compute this allowance, the 'rent' value must be provided for the same month, but 'housing_occupancy_status' is not necessary.\n"