Beispiel #1
0
def test_console_single_core(data_dir):
    report = data_dir / "test_single_core.html"
    console.main(
        ["-s", "--pool_size", "1",
         str(data_dir / "rows.csv"),
         str(report)])
    assert report.exists(), "Report should exist"
Beispiel #2
0
def test_console_multiprocessing(data_dir):
    report = data_dir / "test_samples.html"
    console.main(
        ["-s", "--pool_size", "0",
         str(data_dir / "rows.csv"),
         str(report)])
    assert report.exists(), "Report should exist"
Beispiel #3
0
def test_console_explorative(console_data, test_output_dir):
    report = test_output_dir / "test_explorative.html"
    console.main([
        "-s", "--pool_size", "1", "--explorative",
        str(console_data),
        str(report)
    ])
    assert report.exists(), "Report should exist"
Beispiel #4
0
def test_console_multiprocessing(tmpdir):
    report = tmpdir / "test_samples.html"
    console.main(
        [
            "-s",
            "--pool_size",
            "0",
            "https://data.nasa.gov/api/views/gh4g-9sfh/rows.csv?accessType=DOWNLOAD",
            str(report),
        ]
    )
    assert report.exists(), "Report should exist"
def test_double_config(console_data, test_output_dir):
    report = test_output_dir / "test_double_config.html"
    with pytest.raises(ValueError) as e:
        console.main([
            "--config_file",
            str(get_config_default()),
            "--minimal",
            str(console_data),
            str(report),
        ])

    assert (str(e.value) ==
            "Arguments `config_file` and `minimal` are mutually exclusive.")
def test_issue388(get_data_file, test_output_dir):
    console_data = get_data_file(
        "titanic.csv",
        "https://raw.githubusercontent.com/datasciencedojo/datasets/master/titanic.csv",
    )

    report = test_output_dir / "test_unsupported_extension.foobar"
    with pytest.warns(UserWarning) as warning:
        console.main(["-s", "--pool_size", "1", str(console_data), str(report)])

    assert any("Extension .foobar not supported." in w.message.args[0] for w in warning)

    assert not report.exists(), "Report with .foobar extension shouldn't exist"
    assert report.with_suffix(
        ".html"
    ).exists(), "Report with .html extension should exist"
Beispiel #7
0
def test_console_minimal(console_data, test_output_dir):
    report = test_output_dir / "test_minimal.html"
    console.main(["-s", "--minimal", str(console_data), str(report)])
    assert report.exists(), "Report should exist"
Beispiel #8
0
def test_console_multiprocessing(console_data, test_output_dir):
    report = test_output_dir / "test_samples.html"
    console.main(["-s", "--pool_size", "0", str(console_data), str(report)])
    assert report.exists(), "Report should exist"
Beispiel #9
0
def test_console_minimal(data_dir):
    report = data_dir / "test_minimal.html"
    console.main(["-s", "--minimal", str(data_dir / "rows.csv"), str(report)])
    assert report.exists(), "Report should exist"