def test_plot_cpgram(): y, freq, crit = cpgram([random.random() for i in range(1400)]) n_figs = plt.gcf().number ax = plot_cpgram(y, freq, crit) assert isinstance(ax, matplotlib.axes.Axes) assert n_figs + 1 == plt.gcf().number
def test_check_cpgram(): y, freq, crit = cpgram([random.random() for i in range(1400)]) assert not check_cpgram(y, freq, crit)[0]
def test_cpgram(): y, freq, crit = cpgram([random.random() for i in range(1400)]) assert isinstance(y, np.ndarray) and len(y) == 1399 assert isinstance(freq, np.ndarray) and len(freq) == 1399 assert crit == pytest.approx(0.0361880988)