From 0b20473fa5f7f8affe627b2ad68adac3767b85b1 Mon Sep 17 00:00:00 2001 From: Villu Ruusmann Date: Fri, 6 Dec 2024 18:54:48 +0200 Subject: [PATCH] Migrated package unit tests from 'nose' to 'pytest' --- .github/workflows/python.yaml | 4 ++-- .../tests/{__init__.py => test_cross_reference.py} | 0 .../decoration/tests/{__init__.py => test_decoration.py} | 0 sklearn2pmml/ensemble/tests/{__init__.py => test_ensemble.py} | 0 .../expression/tests/{__init__.py => test_expression.py} | 0 .../text/tests/{__init__.py => test_text.py} | 0 .../tests/{__init__.py => test_feature_selection.py} | 0 sklearn2pmml/metrics/tests/{__init__.py => test_metrics.py} | 0 sklearn2pmml/pipeline/tests/{__init__.py => test_pipeline.py} | 0 .../tests/{__init__.py => test_postprocessing.py} | 0 .../tests/{__init__.py => test_preprocessing.py} | 0 sklearn2pmml/ruleset/tests/{__init__.py => test_ruleset.py} | 0 sklearn2pmml/tests/{__init__.py => test_sklearn2pmml.py} | 0 sklearn2pmml/tree/tests/{__init__.py => test_chaid.py} | 0 sklearn2pmml/util/tests/{__init__.py => test_util.py} | 4 ++-- 15 files changed, 4 insertions(+), 4 deletions(-) rename sklearn2pmml/cross_reference/tests/{__init__.py => test_cross_reference.py} (100%) rename sklearn2pmml/decoration/tests/{__init__.py => test_decoration.py} (100%) rename sklearn2pmml/ensemble/tests/{__init__.py => test_ensemble.py} (100%) rename sklearn2pmml/expression/tests/{__init__.py => test_expression.py} (100%) rename sklearn2pmml/feature_extraction/text/tests/{__init__.py => test_text.py} (100%) rename sklearn2pmml/feature_selection/tests/{__init__.py => test_feature_selection.py} (100%) rename sklearn2pmml/metrics/tests/{__init__.py => test_metrics.py} (100%) rename sklearn2pmml/pipeline/tests/{__init__.py => test_pipeline.py} (100%) rename sklearn2pmml/postprocessing/tests/{__init__.py => test_postprocessing.py} (100%) rename sklearn2pmml/preprocessing/tests/{__init__.py => test_preprocessing.py} (100%) rename sklearn2pmml/ruleset/tests/{__init__.py => test_ruleset.py} (100%) rename sklearn2pmml/tests/{__init__.py => test_sklearn2pmml.py} (100%) rename sklearn2pmml/tree/tests/{__init__.py => test_chaid.py} (100%) rename sklearn2pmml/util/tests/{__init__.py => test_util.py} (98%) diff --git a/.github/workflows/python.yaml b/.github/workflows/python.yaml index a0130b9..2e58415 100644 --- a/.github/workflows/python.yaml +++ b/.github/workflows/python.yaml @@ -32,8 +32,8 @@ jobs: ${{ runner.os }}- - run: | python -m pip install --upgrade pip - pip install nose + pip install pytest pip install --only-binary :all: scikit-learn==${{ matrix.sklearn }} if [ -f requirements.txt ]; then pip install -r requirements.txt; fi - run: | - nosetests + pytest diff --git a/sklearn2pmml/cross_reference/tests/__init__.py b/sklearn2pmml/cross_reference/tests/test_cross_reference.py similarity index 100% rename from sklearn2pmml/cross_reference/tests/__init__.py rename to sklearn2pmml/cross_reference/tests/test_cross_reference.py diff --git a/sklearn2pmml/decoration/tests/__init__.py b/sklearn2pmml/decoration/tests/test_decoration.py similarity index 100% rename from sklearn2pmml/decoration/tests/__init__.py rename to sklearn2pmml/decoration/tests/test_decoration.py diff --git a/sklearn2pmml/ensemble/tests/__init__.py b/sklearn2pmml/ensemble/tests/test_ensemble.py similarity index 100% rename from sklearn2pmml/ensemble/tests/__init__.py rename to sklearn2pmml/ensemble/tests/test_ensemble.py diff --git a/sklearn2pmml/expression/tests/__init__.py b/sklearn2pmml/expression/tests/test_expression.py similarity index 100% rename from sklearn2pmml/expression/tests/__init__.py rename to sklearn2pmml/expression/tests/test_expression.py diff --git a/sklearn2pmml/feature_extraction/text/tests/__init__.py b/sklearn2pmml/feature_extraction/text/tests/test_text.py similarity index 100% rename from sklearn2pmml/feature_extraction/text/tests/__init__.py rename to sklearn2pmml/feature_extraction/text/tests/test_text.py diff --git a/sklearn2pmml/feature_selection/tests/__init__.py b/sklearn2pmml/feature_selection/tests/test_feature_selection.py similarity index 100% rename from sklearn2pmml/feature_selection/tests/__init__.py rename to sklearn2pmml/feature_selection/tests/test_feature_selection.py diff --git a/sklearn2pmml/metrics/tests/__init__.py b/sklearn2pmml/metrics/tests/test_metrics.py similarity index 100% rename from sklearn2pmml/metrics/tests/__init__.py rename to sklearn2pmml/metrics/tests/test_metrics.py diff --git a/sklearn2pmml/pipeline/tests/__init__.py b/sklearn2pmml/pipeline/tests/test_pipeline.py similarity index 100% rename from sklearn2pmml/pipeline/tests/__init__.py rename to sklearn2pmml/pipeline/tests/test_pipeline.py diff --git a/sklearn2pmml/postprocessing/tests/__init__.py b/sklearn2pmml/postprocessing/tests/test_postprocessing.py similarity index 100% rename from sklearn2pmml/postprocessing/tests/__init__.py rename to sklearn2pmml/postprocessing/tests/test_postprocessing.py diff --git a/sklearn2pmml/preprocessing/tests/__init__.py b/sklearn2pmml/preprocessing/tests/test_preprocessing.py similarity index 100% rename from sklearn2pmml/preprocessing/tests/__init__.py rename to sklearn2pmml/preprocessing/tests/test_preprocessing.py diff --git a/sklearn2pmml/ruleset/tests/__init__.py b/sklearn2pmml/ruleset/tests/test_ruleset.py similarity index 100% rename from sklearn2pmml/ruleset/tests/__init__.py rename to sklearn2pmml/ruleset/tests/test_ruleset.py diff --git a/sklearn2pmml/tests/__init__.py b/sklearn2pmml/tests/test_sklearn2pmml.py similarity index 100% rename from sklearn2pmml/tests/__init__.py rename to sklearn2pmml/tests/test_sklearn2pmml.py diff --git a/sklearn2pmml/tree/tests/__init__.py b/sklearn2pmml/tree/tests/test_chaid.py similarity index 100% rename from sklearn2pmml/tree/tests/__init__.py rename to sklearn2pmml/tree/tests/test_chaid.py diff --git a/sklearn2pmml/util/tests/__init__.py b/sklearn2pmml/util/tests/test_util.py similarity index 98% rename from sklearn2pmml/util/tests/__init__.py rename to sklearn2pmml/util/tests/test_util.py index ec50c3d..1cfa7e7 100644 --- a/sklearn2pmml/util/tests/__init__.py +++ b/sklearn2pmml/util/tests/test_util.py @@ -79,9 +79,9 @@ def test_fqn(self): self.assertEqual("builtins.str", fqn(obj)) obj = Dummy() - self.assertEqual("sklearn2pmml.util.tests.Dummy", fqn(Dummy)) + self.assertEqual("test_util.Dummy", fqn(Dummy)) self.assertEqual("builtins.type", fqn(Dummy.__class__)) - self.assertEqual("sklearn2pmml.util.tests.Dummy", fqn(obj)) + self.assertEqual("test_util.Dummy", fqn(obj)) def test_inline_expr(self): expr = "-1 if (X[0] < 0) else (1 if (X[0] > 0) else 0)"