def test_deepcopy_subset(adata, spmat: type):
    adata.obsp["arr"] = np.zeros((adata.n_obs, adata.n_obs))
    adata.obsp["spmat"] = spmat((adata.n_obs, adata.n_obs))

    adata = deepcopy(adata[:10].copy())

    assert isinstance(adata.obsp["arr"], np.ndarray)
    assert not isinstance(adata.obsp["arr"], ArrayView)
    np.testing.assert_array_equal(adata.obsp["arr"].shape, (10, 10))

    assert isinstance(adata.obsp["spmat"], spmat)
    assert not isinstance(
        adata.obsp["spmat"],
        SparseCSRView if spmat is sparse.csr_matrix else SparseCSCView,
    )
    np.testing.assert_array_equal(adata.obsp["spmat"].shape, (10, 10))
def test_conf_inline_ratelimiting(self):
        with mock.patch.object(memcache, 'ConfigParser', get_config_parser()):
            app = memcache.MemcacheMiddleware(
                FakeApp(),
                {'error_suppression_limit': '5',
                 'error_suppression_interval': '2.5'})
        self.assertEqual(app.memcache._error_limit_count, 5)
        self.assertEqual(app.memcache._error_limit_time, 2.5)
        self.assertEqual(app.memcache._error_limit_duration, 2.5)