From 9219b06d24ec53aef3c7f5e1a4d48946d0c6a99b Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Mon, 20 Sep 2021 00:20:50 +0200 Subject: [PATCH 1/2] Fix yaml tests bug --- tests/core/test_yaml.py | 5 ++--- tests/fixtures/yaml_tests/__init__.py | 0 .../yaml_tests/directory/subdirectory/test_4.yaml | 0 tests/{core => fixtures}/yaml_tests/directory/test_1.yaml | 0 tests/{core => fixtures}/yaml_tests/directory/test_2.yaml | 0 .../yaml_tests/failing_test_absolute_error_margin.yaml | 0 .../yaml_tests/failing_test_relative_error_margin.yaml | 0 .../yaml_tests/test_absolute_error_margin.yaml | 0 tests/{core => fixtures}/yaml_tests/test_failure.yaml | 0 tests/{core => fixtures}/yaml_tests/test_name_filter.yaml | 0 .../yaml_tests/test_relative_error_margin.yaml | 0 tests/{core => fixtures}/yaml_tests/test_success.yml | 0 tests/{core => fixtures}/yaml_tests/test_with_anchors.yaml | 0 tests/{core => fixtures}/yaml_tests/test_with_extension.yaml | 0 tests/{core => fixtures}/yaml_tests/test_with_reform.yaml | 0 tests/{core => fixtures}/yaml_tests/test_with_reform_2.yaml | 0 16 files changed, 2 insertions(+), 3 deletions(-) create mode 100644 tests/fixtures/yaml_tests/__init__.py rename tests/{core => fixtures}/yaml_tests/directory/subdirectory/test_4.yaml (100%) rename tests/{core => fixtures}/yaml_tests/directory/test_1.yaml (100%) rename tests/{core => fixtures}/yaml_tests/directory/test_2.yaml (100%) rename tests/{core => fixtures}/yaml_tests/failing_test_absolute_error_margin.yaml (100%) rename tests/{core => fixtures}/yaml_tests/failing_test_relative_error_margin.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_absolute_error_margin.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_failure.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_name_filter.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_relative_error_margin.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_success.yml (100%) rename tests/{core => fixtures}/yaml_tests/test_with_anchors.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_with_extension.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_with_reform.yaml (100%) rename tests/{core => fixtures}/yaml_tests/test_with_reform_2.yaml (100%) diff --git a/tests/core/test_yaml.py b/tests/core/test_yaml.py index 15085dbbf3..f63e37ff39 100644 --- a/tests/core/test_yaml.py +++ b/tests/core/test_yaml.py @@ -1,4 +1,3 @@ -import pkg_resources import os import subprocess @@ -7,9 +6,9 @@ from openfisca_core.tools.test_runner import run_tests +from tests.fixtures import yaml_tests -openfisca_core_dir = pkg_resources.get_distribution('OpenFisca-Core').location -yaml_tests_dir = os.path.join(openfisca_core_dir, 'tests', 'core', 'yaml_tests') +yaml_tests_dir = os.path.dirname(yaml_tests.__file__) EXIT_OK = 0 EXIT_TESTSFAILED = 1 diff --git a/tests/fixtures/yaml_tests/__init__.py b/tests/fixtures/yaml_tests/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/tests/core/yaml_tests/directory/subdirectory/test_4.yaml b/tests/fixtures/yaml_tests/directory/subdirectory/test_4.yaml similarity index 100% rename from tests/core/yaml_tests/directory/subdirectory/test_4.yaml rename to tests/fixtures/yaml_tests/directory/subdirectory/test_4.yaml diff --git a/tests/core/yaml_tests/directory/test_1.yaml b/tests/fixtures/yaml_tests/directory/test_1.yaml similarity index 100% rename from tests/core/yaml_tests/directory/test_1.yaml rename to tests/fixtures/yaml_tests/directory/test_1.yaml diff --git a/tests/core/yaml_tests/directory/test_2.yaml b/tests/fixtures/yaml_tests/directory/test_2.yaml similarity index 100% rename from tests/core/yaml_tests/directory/test_2.yaml rename to tests/fixtures/yaml_tests/directory/test_2.yaml diff --git a/tests/core/yaml_tests/failing_test_absolute_error_margin.yaml b/tests/fixtures/yaml_tests/failing_test_absolute_error_margin.yaml similarity index 100% rename from tests/core/yaml_tests/failing_test_absolute_error_margin.yaml rename to tests/fixtures/yaml_tests/failing_test_absolute_error_margin.yaml diff --git a/tests/core/yaml_tests/failing_test_relative_error_margin.yaml b/tests/fixtures/yaml_tests/failing_test_relative_error_margin.yaml similarity index 100% rename from tests/core/yaml_tests/failing_test_relative_error_margin.yaml rename to tests/fixtures/yaml_tests/failing_test_relative_error_margin.yaml diff --git a/tests/core/yaml_tests/test_absolute_error_margin.yaml b/tests/fixtures/yaml_tests/test_absolute_error_margin.yaml similarity index 100% rename from tests/core/yaml_tests/test_absolute_error_margin.yaml rename to tests/fixtures/yaml_tests/test_absolute_error_margin.yaml diff --git a/tests/core/yaml_tests/test_failure.yaml b/tests/fixtures/yaml_tests/test_failure.yaml similarity index 100% rename from tests/core/yaml_tests/test_failure.yaml rename to tests/fixtures/yaml_tests/test_failure.yaml diff --git a/tests/core/yaml_tests/test_name_filter.yaml b/tests/fixtures/yaml_tests/test_name_filter.yaml similarity index 100% rename from tests/core/yaml_tests/test_name_filter.yaml rename to tests/fixtures/yaml_tests/test_name_filter.yaml diff --git a/tests/core/yaml_tests/test_relative_error_margin.yaml b/tests/fixtures/yaml_tests/test_relative_error_margin.yaml similarity index 100% rename from tests/core/yaml_tests/test_relative_error_margin.yaml rename to tests/fixtures/yaml_tests/test_relative_error_margin.yaml diff --git a/tests/core/yaml_tests/test_success.yml b/tests/fixtures/yaml_tests/test_success.yml similarity index 100% rename from tests/core/yaml_tests/test_success.yml rename to tests/fixtures/yaml_tests/test_success.yml diff --git a/tests/core/yaml_tests/test_with_anchors.yaml b/tests/fixtures/yaml_tests/test_with_anchors.yaml similarity index 100% rename from tests/core/yaml_tests/test_with_anchors.yaml rename to tests/fixtures/yaml_tests/test_with_anchors.yaml diff --git a/tests/core/yaml_tests/test_with_extension.yaml b/tests/fixtures/yaml_tests/test_with_extension.yaml similarity index 100% rename from tests/core/yaml_tests/test_with_extension.yaml rename to tests/fixtures/yaml_tests/test_with_extension.yaml diff --git a/tests/core/yaml_tests/test_with_reform.yaml b/tests/fixtures/yaml_tests/test_with_reform.yaml similarity index 100% rename from tests/core/yaml_tests/test_with_reform.yaml rename to tests/fixtures/yaml_tests/test_with_reform.yaml diff --git a/tests/core/yaml_tests/test_with_reform_2.yaml b/tests/fixtures/yaml_tests/test_with_reform_2.yaml similarity index 100% rename from tests/core/yaml_tests/test_with_reform_2.yaml rename to tests/fixtures/yaml_tests/test_with_reform_2.yaml From b126443b1e34992f97e48119059c27f4f9bdc311 Mon Sep 17 00:00:00 2001 From: Mauko Quiroga Date: Fri, 1 Oct 2021 13:30:15 +0200 Subject: [PATCH 2/2] Bump patch to 35.5.2 --- CHANGELOG.md | 7 +++++++ setup.py | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index ec66f40e3c..4fcb535f9a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,12 @@ # Changelog +### 35.5.2 [#1048](https://github.com/openfisca/openfisca-core/pull/1048) + +#### Bug fix + +- In _test_yaml.py_: + - Fix yaml tests loading —required for testing against the built version. + ### 35.5.1 [#1046](https://github.com/openfisca/openfisca-core/pull/1046) #### Non-technical changes diff --git a/setup.py b/setup.py index 396435263d..01e036df50 100644 --- a/setup.py +++ b/setup.py @@ -36,7 +36,7 @@ setup( name = 'OpenFisca-Core', - version = '35.5.1', + version = '35.5.2', author = 'OpenFisca Team', author_email = 'contact@openfisca.org', classifiers = [