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

BUG: Correct filepath for doctest requiring local resource #171

Merged
merged 2 commits into from
Aug 13, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/pip.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ jobs:
- name: Test pytest plugin
# This test will fail in a venv where scipy_doctest has not been installed and the plugin has not been activated
run: |
test_files=("scipy_doctest/tests/module_cases.py" "scipy_doctest/tests/stopwords_cases.py")
test_files=("scipy_doctest/tests/module_cases.py" "scipy_doctest/tests/stopwords_cases.py" "scipy_doctest/tests/local_file_cases.py")
for file in "${test_files[@]}"; do
python -m pytest "${file}" --doctest-modules
done
2 changes: 1 addition & 1 deletion scipy_doctest/tests/local_file_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# Specify local files required by doctests
dt_config.local_resources = {
'scipy_doctest.tests.local_file_cases.local_files': ['local_file.txt'],
'scipy_doctest.local_file_cases.sio': ['octave_a.mat']
'scipy_doctest.tests.local_file_cases.sio': ['octave_a.mat']
}


Expand Down
4 changes: 1 addition & 3 deletions scipy_doctest/tests/test_pytest_configuration.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,9 @@ def test_stopword_cases(pytester):
assert result.ret == pytest.ExitCode.OK


@pytest.mark.xfail(reason="XXX: passes locally, fails on CI")
@pytest.mark.skipif(not HAVE_SCIPY, reason='need scipy')
def test_local_file_cases(pytester):
"""Test that local files are found for use in doctests.
"""
"""Test that local files are found for use in doctests."""
path_str = local_file_cases.__file__
python_file = Path(path_str)
result = pytester.inline_run(python_file, "--doctest-modules")
Expand Down