8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 0f245d4 commit 9c857f6Copy full SHA for 9c857f6
sklearn/tests/test_base.py
@@ -386,3 +386,16 @@ def test_pickling_constraints_work_in_multiple_inheritance_setting():
386
estimator_restored = pickle.loads(serialized)
387
assert estimator_restored.b == 5
388
assert estimator_restored._cache is None
389
+
390
391
+class SingleInheritanceEstimator(BaseEstimator):
392
+ def __init__(self, b=5):
393
+ self.b = b
394
395
396
+def test_pickling_uses_object_dictionary_when_getstate_not_present():
397
+ estimator = MultiInheritanceEstimator()
398
399
+ serialized = pickle.dumps(estimator, protocol=2)
400
+ estimator_restored = pickle.loads(serialized)
401
+ assert estimator_restored.b == 5
0 commit comments