示例#1
0
    def test_plot_invalid_kind(self):

        with pytest.raises(ValueError, match=r"invalid_kind"):

            plot([str(DUMMY_BENCHMARK), '-k', 'invalid_kind'],
                 'benchopt',
                 standalone_mode=False)
示例#2
0
    def test_valid_call(self, kind):

        out = SuppressStd()
        with out:
            plot([
                str(DUMMY_BENCHMARK), '-f', self.result_file, '-k', kind,
                '--no-display'
            ],
                 'benchopt',
                 standalone_mode=False)
        saved_files = re.findall(r'Save .* as: (.*\.pdf)', out.output)
        assert len(saved_files) == 1
        saved_file = saved_files[0]
        assert kind in saved_file

        Path(saved_file).unlink()
示例#3
0
    def test_plot_invalid_file(self):

        with pytest.raises(FileNotFoundError, match=r"invalid_file"):
            plot([str(DUMMY_BENCHMARK), '-f', 'invalid_file'],
                 'benchopt',
                 standalone_mode=False)