@pytest.mark.filterwarnings('ignore::fitsio.FITSRuntimeWarning')
def test_savesim(simulation, PSRfits):
    '\n    Test save simulation function.\n    '
    simulation._Nchan = 1
    simulation._tobs = 2.0
    simulation.simulate(from_template=True)
    simulation.save_simulation(out_format='pdv')
    simulation.save_simulation(out_format='psrfits', phaseconnect=False)
    os.remove('sim_fits.fits')
    dfs = glob.glob('simfits*')
    for df in dfs:
        os.remove(df)
    with pytest.raises(RuntimeError):
        simulation.save_simulation(out_format='wrong_fmt')
        simulation._tempfile = None
        simulation.save_simulation(out_format='psrfits')
Test save simulation function.
@pytest.mark.filterwarnings('ignore::fitsio.FITSRuntimeWarning')
def test_savesim(simulation, PSRfits):
    '\n    \n    '
    simulation._Nchan = 1
    simulation._tobs = 2.0
    simulation.simulate(from_template=True)
    simulation.save_simulation(out_format='pdv')
    simulation.save_simulation(out_format='psrfits', phaseconnect=False)
    os.remove('sim_fits.fits')
    dfs = glob.glob('simfits*')
    for df in dfs:
        os.remove(df)
    with pytest.raises(RuntimeError):
        simulation.save_simulation(out_format='wrong_fmt')
        simulation._tempfile = None
        simulation.save_simulation(out_format='psrfits')