Skip to content

Slash "/" in test name #44

@gshiba

Description

@gshiba

My code (simplified)

@pytest.fixture(params=['/some/data1', '/some/data2'])
def dataframe(reqeust):
    return transform(request.param)

@pytest.mark.mpl_image_compare(baseline_dir=BASELINE_DIR)
def test_plot(dataframe):
    fig = my_plotter(dataframe)
    return fig

When I run pytest test_my_plotters.py --mpl --mpl-generate-path=baseline, I get something like (simplified):

IOError: [Errno 2] No such file or directory: '.../baseline/test_plot_/some/data1.png'

../venv/local/lib/python2.7/site-packages/matplotlib/backends/backend_agg.py:532: IOError

In short, print_png in matplotlib/backends/backend_agg.py is failing because the intermediate paths (.../some/...) is missing.

This work around seems to work (gshiba@3c8aa6e) but not sure if this is the right approach.

Thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions