Skip to content

Commit

Permalink
Rename tests folder to test. Switch to naming test folders rather tha…
Browse files Browse the repository at this point in the history
…n using environment variables.
  • Loading branch information
above-c-level committed Dec 2, 2018
1 parent fd29889 commit 82ac220
Show file tree
Hide file tree
Showing 20 changed files with 28 additions and 44 deletions.
22 changes: 3 additions & 19 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,34 +21,18 @@ jobs:
- stage: Core Tests
python:
- 3.6
env:
- CORE_TESTS=tests/core_tests/scoring_tests.py
- CORE_TESTS=tests/core_tests/basic_tests.py
- CORE_TESTS=tests/core_tests/api_coverage_tests_classifiers.py
- CORE_TESTS=tests/core_tests/api_coverage_tests_regressors.py
- CORE_TESTS=tests/core_tests/calibrate_classifier_tests.py
- CORE_TESTS=tests/core_tests/categorical_ensembling_test.py
- CORE_TESTS=tests/core_tests/test_prediction_intervals.py
- CORE_TESTS=tests/core_tests/trained_transformation_pipeline_tests.py
- CORE_TESTS=tests/core_tests/uncertainty_tests.py
- CORE_TESTS=tests/core_tests/user_logging_tests.py
script:
- nosetests $CORE_TESTS
- nosetests test/core_tests
- coveralls
- coverage xml
- ./cc-test-reporter format-coverage

- stage: Advanced tests
- stage: Advanced Tests
python:
- 3.6
env:
- ADVANCED_TESTS=tests/advanced_tests/automated_tests_regressors.py
- ADVANCED_TESTS=tests/advanced_tests/automated_tests_classifiers.py
- ADVANCED_TESTS=tests/advanced_tests/advanced_install_tests.py
install:
- pip install lightgbm keras tensorflow catboost xgboost
script:
- nosetests $ADVANCED_TESTS
- nosetests test/advanced_tests
- coveralls
- coverage xml
- ./cc-test-reporter format-coverage
Expand Down
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
import numpy as np
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils
from cash_ml import Predictor
from cash_ml.utils_models import load_ml_model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
import sys
from collections import OrderedDict

import tests.advanced_tests.classifiers as classifier_tests
import test.advanced_tests.classifiers as classifier_tests

sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
os.environ['is_test_suite'] = 'True'
Expand All @@ -11,7 +11,7 @@
'model_names': ['DeepLearning', 'GradientBoosting', 'XGB', 'LGBM', 'CatBoost']
}

# Make this an OrderedDict so that we run the tests in a consistent order
# Make this an OrderedDict so that we run the test in a consistent order
test_names = OrderedDict([
('getting_single_predictions_multilabel_classification',
classifier_tests.getting_single_predictions_multilabel_classification),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
# Splitting this in half to see if it helps with how nosetests splits up our parallel tests
# Splitting this in half to see if it helps with how nosetests splits up our parallel test
import os
import sys
from collections import OrderedDict

import tests.advanced_tests.regressors as regressor_tests
import test.advanced_tests.regressors as regressor_tests

sys.path = [os.path.abspath(os.path.dirname(__file__))] + sys.path
os.environ['is_test_suite'] = 'True'
Expand All @@ -12,7 +12,7 @@
'model_names': ['DeepLearning', 'GradientBoosting', 'XGB', 'LGBM', 'CatBoost']
}

# Make this an OrderedDict so that we run the tests in a consistent order
# Make this an OrderedDict so that we run the test in a consistent order
test_names = OrderedDict([
('optimize_final_model_regression', regressor_tests.optimize_final_model_regression),
# ('getting_single_predictions_regression', regressor_tests.getting_single_predictions_regression),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils
from cash_ml import Predictor
from cash_ml.utils_models import load_ml_model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

import numpy as np

import tests.utils_testing as utils
import test.utils_testing as utils
from cash_ml import Predictor
from cash_ml.utils_models import load_ml_model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
import numpy as np
from sklearn.metrics import accuracy_score

import tests.utils_testing as utils
import test.utils_testing as utils
from cash_ml import Predictor
from cash_ml.utils_models import load_ml_model

Expand Down Expand Up @@ -47,7 +47,7 @@ def test_perform_feature_selection_false_classification():

# For some reason, this test now causes a Segmentation Default on travis when run on python 3.5.
# home/travis/.travis/job_stages: line 53: 8810 Segmentation fault
# (core dumped) nosetests -v --with-coverage --cover-package cash_ml tests
# (core dumped) nosetests -v --with-coverage --cover-package cash_ml test
# It didn't error previously
# It appears to be an environment issue (possibly caused by running too many parallelized things,
# which only happens in a test suite), not an issue with cash_ml.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
import numpy as np
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils

# Tests on regression models:

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
To get standard out, run nosetests as follows:
nosetests -sv tests
nosetests --verbosity=2 --detailed-errors --nologcapture --processes=4 --process-restartworker --process-timeout=1000 tests
nosetests -sv test
nosetests --verbosity=2 --detailed-errors --nologcapture --processes=4 --process-restartworker --process-timeout=1000 test
"""
import datetime
import os
Expand All @@ -20,7 +20,7 @@

import dill
import numpy as np
import tests.utils_testing as utils
import test.utils_testing as utils


def test_linear_model_analytics_classification(model_name=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import numpy as np
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils


def test_calibrate_final_model_classification():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
from sklearn.metrics import accuracy_score
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils


def test_categorical_ensemble_basic_classifier():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@

import dill
import numpy as np
import tests.utils_testing as utils
import test.utils_testing as utils


def ensemble_classifier_basic_test(model_name=None):
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# """
# nosetests -sv --nologcapture tests/quick_test.py
# nosetests --verbosity=2 --detailed-errors --nologcapture --processes=4 --process-restartworker --process-timeout=1000 tests/quick_test.py
# nosetests -sv --nologcapture test/quick_test.py
# nosetests --verbosity=2 --detailed-errors --nologcapture --processes=4 --process-restartworker --process-timeout=1000 test/quick_test.py
# """

import os
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
from cash_ml import Predictor
import numpy as np

import tests.utils_testing as utils
import test.utils_testing as utils


def always_return_ten_thousand(estimator=None, actuals=None, probas=None):
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pandas as pd
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils


def test_predict_uncertainty_true():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
import numpy as np
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils


def test_already_transformed_X():
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
import pandas as pd
from sklearn.model_selection import train_test_split

import tests.utils_testing as utils
import test.utils_testing as utils


def test_predict_uncertainty_returns_pandas_DataFrame_for_more_than_one_value():
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This set of tests id specifically designed to make sure cash_ml is user friendly- throwing useful warnings where possible about what specific actions the user can take to avoid an error, instead of throwing the non-obvious error messages that the underlying libraries will choke on.
# This set of test id specifically designed to make sure cash_ml is user friendly- throwing useful warnings where possible about what specific actions the user can take to avoid an error, instead of throwing the non-obvious error messages that the underlying libraries will choke on.
import datetime
import dill
from nose.tools import raises
Expand All @@ -13,7 +13,7 @@
os.environ['is_test_suite'] = 'True'

from cash_ml import Predictor
import tests.utils_testing as utils
import test.utils_testing as utils


@raises(ValueError)
Expand Down
File renamed without changes.

0 comments on commit 82ac220

Please sign in to comment.