'Testing when fits file is passed as pathlib.Path object #4412.'

@pytest.mark.skipif('not    HAS_PATHLIB')
def test_fits_file_path_object(self):

    fpath = pathlib.Path(get_pkg_data_filename('data/tdim.fits'))
    hdulist = fits.open(fpath)
    assert (hdulist[0].filebytes() == 2880)
    assert (hdulist[1].filebytes() == 5760)
    hdulist2 = fits.open(self.data('tdim.fits'))
    assert (FITSDiff(hdulist2, hdulist).identical is True)
