'Regression test for https://github.com/astropy/astropy/pull/4514
Tests that columns with the P/Q formats (variable length arrays) can be
deep-copied.'

def test_p_column_deepcopy(self):

    c = fits.Column('pcol', format='PJ', array=[[1, 2], [3, 4, 5]])
    c2 = copy.deepcopy(c)
    assert (c2.name == c.name)
    assert (c2.format == c.format)
    assert np.all((c2.array[0] == c.array[0]))
    assert np.all((c2.array[1] == c.array[1]))
    c3 = fits.Column('qcol', format='QJ', array=[[1, 2], [3, 4, 5]])
    c4 = copy.deepcopy(c3)
    assert (c4.name == c3.name)
    assert (c4.format == c3.format)
    assert np.all((c4.array[0] == c3.array[0]))
    assert np.all((c4.array[1] == c3.array[1]))
