You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In #19535, we decided that auto-generating the fixtures with pytest_generate_tests is perhaps a bit too magical. Wherever possible, it'd be better to just explicitly write out the fixtures, e.g. like
@pytest.fixture(params=['chinese_utf-16.html','chinese_utf-32.html','chinese_utf-8.html','letz_latin1.html',])defhtml_encoding_file(request, datapath):
"""Parametrized fixture for HTML encoding test filenames."""returndatapath('io', 'data', 'html_encoding', request.param)
In #19535 we're excluding data test files from the distribution, which required some changes.
The hardest tests to update were the IO ones that read in a bunch of files in
setup
and set them as attributes onself
.In the PR, I changed these setup / teardown methods to be yield-base autouse yield methods. See https://github.com/pandas-dev/pandas/pull/19535/files#diff-8cfd1704100c1e13de1bac288482b344R41 for an example.
Ideally we would change the tests to accept the file / parsed object as a fixture, rather than accessing it off
self
.The hard part is generating fixtures dynamically, e.g. one fixture per CSV in this directory. We can accomplish that with
pytest_generate_tests
: https://github.com/pandas-dev/pandas/pull/19535/files#diff-3f782eafb799811bd5516f328411418dR31The text was updated successfully, but these errors were encountered: