Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use audeer.path() instead of os.path.join() in docstring examples #95

Open
hagenw opened this issue Feb 7, 2023 · 1 comment
Open
Labels
documentation Improvements or additions to documentation enhancement New feature or request

Comments

@hagenw
Copy link
Member

hagenw commented Feb 7, 2023

As pointed out at #94 (comment) we currently use os.path.join() in the docstrings as audeer.path() is not available as we import it as safe_path() so we can use path as a variable.

But it would be good to use path() in the examples. One workaround might be to inject it with a conftest.py, e.g.

import pytest

import audeer


@pytest.fixture(autouse=True)
def add_pd(doctest_namespace):
    doctest_namespace['path'] = audeer.path

But then we have to make sure to not use the variable path in the docstring examples.

@hagenw hagenw added documentation Improvements or additions to documentation enhancement New feature or request labels Feb 7, 2023
@frankenjoe
Copy link
Collaborator

frankenjoe commented Feb 7, 2023

The other option we have is to create some sample files in the fixture as we do in audbackend.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants