Commit Graph

47 Commits

Author SHA1 Message Date
Dimitri Papadopoulos Orfanos ee5a1b69d1
DOC, MNT Typos found by codespell (#22906) 2022-03-20 19:16:39 +01:00
Jérémie du Boisberranger b9bd2d524d
API Deprecate if_delegate_has_method (#22830) 2022-03-17 13:16:53 -04:00
Julien Jerphanion 613773db11
TST Add minimal setup to be able to run test suite on float32 (#22690)
Co-authored-by: Thomas J. Fan <thomasjpfan@gmail.com>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
Co-authored-by: Jérémie du Boisberranger <jeremiedbb@users.noreply.github.com>
2022-03-17 14:25:17 +01:00
Thomas J. Fan 30c89280ce
MAINT Adjust tests for numpydoc 1.2 (#22287)
Co-authored-by: Julien Jerphanion <git@jjerphan.xyz>
Co-authored-by: Olivier Grisel <olivier.grisel@ensta.org>
2022-02-11 17:11:50 +01:00
Christian Lorentzen 3f717cc48a
[MRG] FIX segmentation fault on memory mapped contiguous memoryview (#21654) 2021-11-18 14:55:48 +01:00
Guillaume Lemaitre a8d28274ef
MNT replace if_delagate_has_method by available_if in testing (#20686)
* MNT replace if_delagate_has_method by available_if in testing

* iter
2021-08-31 12:39:46 +02:00
Olivier Grisel 504682172b
MAINT deprecate assert_warns and assert_warns_messsage (#20521)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-07-20 15:01:16 +02:00
Juan Martin Loyola b0cac5339a
TST Replace assert_warns with pytest context manager in sklearn/utilst/tests/test_testing.py (#20436) 2021-07-06 10:58:29 +02:00
Juan Martin Loyola 0d343bb2d2
Replace assert_warns* with pytest context manager in sklearn/utilst/tests/* (#20421) 2021-06-30 23:57:16 +02:00
Thomas J. Fan 3ae7c76153
STY Enables black with experimental_string_processing=true (#20412) 2021-06-29 09:47:04 +02:00
Thomas J. Fan 82df48934e
MNT Applies black formatting to most of the code base (#18948) 2021-06-17 14:21:09 -04:00
Andrew Delong a67b284f90
FIX Encoder should accept categories having dtype='S' (#19727)
Co-authored-by: Guillaume Lemaitre <g.lemaitre58@gmail.com>
2021-04-21 17:34:28 -04:00
Nicolas Hug 5721629fd3
MNT Use a pytest-like context manager in estimator_checks.py (#18418) 2020-09-28 15:05:43 -04:00
Nicolas Hug 1931e142ed
Remove deprecated utils (#17133) 2020-05-20 22:03:54 +02:00
Roman Feldbauer 9b39c4c4d2
TST Fix unreachable code in tests (#16110) 2020-02-16 14:41:26 +01:00
Alexandre Batisse 418e0d55d3
[MRG] CLN Remove the use of assert_raises in utils/ (#16337)
* CLN use pytest raises ctxt manager for class weights & estimators [skip ci]

* CLN use pytest raises ctxt manager for multiclass test

* CLN use pytest warns in estimator checks test

* CLN use pytest raises ctxt manager for random test

* CLN use pytest raises ctxt manager for sparsefuncs test

* CLN use pytest raises ctxt manager for testing utils tests

* CLN use pytest raises ctxt manager for utils tests

* CLN use pytest raises ctxt manager for validation tests

* revert test_estimator_check.py to upstream master
2020-02-02 14:44:19 +01:00
Guillaume Lemaitre c311efd501 FIX accept pandas Index for feature_names in PDP (#15639) 2019-11-18 06:39:43 -06:00
Nicolas Hug 19ad136223 MNT Replace DeprecationWarning with FutureWarning (#15080)
* bruteforce renaming

* WIP

* WIP

* some more

* removed weird line

* update -Werror

* testiforest

* again

* Fixed some tests

* fixed some tests

* removed -Werror

* fixed test_docstring_param issue

* fixed some tests

* some more

* renamed to SklearnDeprecationWarning

* pep8

* updated docs

* pep8

* merge

* changed to FutureWarning

* fixes

* Update doc/developers/tips.rst

Co-Authored-By: Adrin Jalali <adrin.jalali@gmail.com>

* avoid duplicates

* fixed warning for deprecations

* Still make CI break if DeprecationWarning isn't caught

* updated one warning

* fixed test

* fixed some renamings

* updated new dep warnings

* fixed bad import

* ignore warnings

* update again

* ignore futurewarning when walking packages

* Fixed test

* pep8

* Added whatsnew
2019-10-29 15:39:26 +01:00
Nicolas Hug b92455a6b2 MAINT Deprecate all of utils.testing except all_estimators (#15367) 2019-10-28 17:28:56 +01:00
Nicolas Hug f3eb9d2206 [MRG] MNT removing assert_equal, etc -- continued (#14232) 2019-07-02 14:53:51 +10:00
Adrin Jalali 19c068a2ec MNT towards removing assert_equal, etc (#14222) 2019-07-01 09:13:32 -04:00
Antonio Gutierrez 8681ece373 ENH Fix unfriendly error message for documentation checks (#11967)
Previously error messages for mismatches parameters on function/method
signatures and docstrings were not explicit or user-friendly. This
changes provides a more explicit error message and in addition notifies
the relation of missing/mismatching parameters from signature to
docstring and from docstring to signature.
2019-06-21 17:06:57 -07:00
Roman Yurchak 0e3bb17e62 MAINT Run pyupgrade following Python2 deprecation (#12997) 2019-02-08 20:13:34 +08:00
Hanmin Qin 575064b8e1
MNT More clean up after we remove python < 3.5 (#13078) 2019-02-02 22:01:13 +08:00
Loïc Estève e1dd0d85c4 FIX: ensure that category warning are passed as a kwargs in ignore_warnings (#11599) 2018-07-17 22:50:32 +02:00
Shangwu Yao cb1dbc25a7 MNT: reduce the number of warnings in test_common.py (#11151)
Improve handling of warning filters in sklearn.utils.testing by avoiding to reset warnings.filters.
2018-06-11 08:59:12 +02:00
Loïc Estève 9ea723f07a [MRG+1] Read-only memmap input data in common tests (#10663) 2018-04-23 14:58:40 +02:00
Joel Nothman 116c96c7cc [MRG] CI Reinstate docstring testing (#10473) 2018-02-10 08:47:42 -08:00
Kumar Ashutosh 2b9405f977 [MRG] Backports msg in assert_raises and assert_raises_regex (#9536)
* Added modifiedunittest

* Backports msg in assertRaises and assertRaisesRegexp

* Import statement corrected

* Corrected import statement

* Added module name in utils.setup.py

* Removed Extra modules

* Reordered class

* _is_subtype added

* Missing import added

* _formatMessage added

* missing variables added

* Remove PEP8 failures

* Removed safe_repr

* _unittest_backport.py added

* Import statement corrected

* Added copyright

* Syntax Error removed

* Error removed

* runTest function added

* Tests added

* __init__ added

* Import added
2017-08-17 09:05:24 +10:00
(Venkat) Raghav, Rajagopalan b6f8865b0a [MRG + 1 (rv) + 1 (alex) + 1] Add a check to test the docstring params and their order (#9206)
* add automatic test of docstrings for function / method signatures using numpydoc
2017-07-11 18:42:10 +02:00
Andreas Mueller d788dcb199 [MRG+1] Instance level common tests (#9019)
* start work on separating instance-level tests

* minor refactoring / fixes to work without tags

* add clone into check_supervised_y_2d estimator check (which made other checks fail)

* remove duplicate check_estimator_unfitted assert

* add issue reference to whatsnew entry

* added some clones, minor fixes from vene's review

* rename estimator arg to estimator_org to make a visible distinction before and after cloning.

* more renaming for more explicit clones

* org -> orig

* allclose, fix orig stuff

* don't use set_testing_parameters in the checks!

* minor fixes for allclose

* fix some test, add more tests on classes

* added the test using pickles.

* move assert_almost_equal_dense_sparse to utils.testing, rename to assert_allclose_sparse_dense, test it

* make assert_allclose_dense_sparse more stringent

* more allclose fixes

* run test_check_estimator on all estimators

* rename set_testing_parameters to set_checking_parameters so nose doesn't think it's a tests (and I don't want to import stuff from nose as we want to remove it)

* fix in set_checking_parameters so that common tests pass

* more fixes to assert_allclose_dense_sparse

* rename alg to clusterer, don't scream even though I really want to

* ok this is not a pretty strict test that runs check_estimator with and without fitting on an instance. I also check if ``fit`` is called on the instance that is passed.

* simplify test as they didn't help at all

* it works!!! omfg

* run check_estimator clone test only on one of the configs, don't run locally by default

* Add `slow_test` decorator and documentation

* run test_check_estimator only on some estimators

* fix diags in test for older scipy

* fix pep8 and shorten

* use joblib.hash for inequality check because the pickle state machine is weird
2017-06-09 16:33:57 +02:00
Loïc Estève e5bf61eee1 [MRG+1] Dropping python 2.6 support (#7890)
* Remove Python 2.6 support

Some details about some slightly orthogonal changes:
* Note about cheking safely for nan is likely not valid any more (commit
  introducing it is c80ca91b)
* scipy.linalg.qr econ parameter removed since scipy 0.9 in favour of
  mode='economic'
* Remove unnecessary libgfortran in conda create command

* Putative fix by setting the random seed

* Revert unintended change

* Reinstate previous logic for checking for NaNs

* Reinstate change in error message

Error messages from Python 2.7 assertRegexp does not contain the
function name, in contrast with Python 3 assertRegex
2016-11-23 17:11:04 -05:00
Konstantin Podshumok 9b2aac9e5c [MRG + 1] [TST] (half-cosmetic) use less nose.tools import to simplify future transition to py.test (#7384)
* use less nose.tools import to simplify future transition to activly developing test suites/runners

* assert_equal -> assert_array_equal in test_feature_hasher_pairs_with_string_values

and one missed ImportError that should be replaced with AttributeError

* test for py2.6 compat with except AttributeError

* fix importing of SkipTest

* force using nose in python2.6 for now

* there was no assert_dict_equal in py2.6. but we can use assert_equal

although failed test will look a little bit ugly

* remove nose imports from doc/datasets
2016-10-07 12:46:52 -04:00
Thierry 6fb6c63b7b Modification of the ignore_warning function and _IgnoreWarning class. 2016-04-21 18:28:44 +02:00
Vinayak Mehta 679936f6bc MAINT Deprecate LDA/QDA in favor of expanded names
The LDA accronym for Linear Discriminant Analysis is ambiguous
because of the newly introduced Latent Dirichlet Allocation model.

We therefore deprecate the sklearn.lda.LDA and sklearn.lda.QDA
in favor of explicit names.
2015-09-11 15:32:11 +02:00
TomDLT fe38e2509d ENH check that unfitted estimators raise ValueError 2015-05-20 16:40:19 +02:00
MechCoder 4213c0461b DOC: Make it explicit that assert_warns clears the warning registry 2014-10-14 10:57:43 +02:00
MechCoder 34df94d6c5 TST: Test that assert_warns is reset internally 2014-10-13 23:13:52 +02:00
MechCoder 859992ae90 TST: Test that the warning registry is empty after assert_warns
Also minor doc change to the statement that this class was
copied from NumPy
2014-10-13 14:56:29 +02:00
MechCoder 54eb4784ba FIX: Remove test that tests state of warnings before and after assert_warns 2014-10-10 17:14:41 +02:00
Noel Dawe 6f4b31aabd test assert_greater_equal and assert_less_equal 2014-07-02 11:47:32 +02:00
Andreas Mueller 5a1fde1194 COSMIT fixing some unused imports, adding stuff to __all__, and light pep8 (not all whitespace to make rebasing less painful) 2013-07-27 15:44:17 +02:00
Arnaud Joly cdfaa825f5 Backport assert_warns and assert_no_warnings from np 1.7 2013-07-27 15:01:50 +02:00
Arnaud Joly db4422fcf9 ENH Simplify assert_raise_message + TST add them 2012-12-21 14:48:01 +01:00
Andreas Mueller 9babaa72e2 ENH minor improvements in testing, new utility function for safely setting random states. 2012-11-02 09:23:15 +00:00
Andreas Mueller 1ebcc4a486 COSMIT pep8 2012-05-15 21:18:30 +02:00
Gael Varoquaux 1cf2faae9e BUG: fix assert_greater
And add a test: when doing a backport, it is always wise to check ones
implementation against the original
2012-05-06 17:10:55 +02:00