scipy / scipy_doctest

Floating-point aware doctesting
BSD 3-Clause "New" or "Revised" License
5 stars 4 forks source link

BUG: run tests in a tempdir, copy needed local files #111

Closed ev-br closed 6 months ago

ev-br commented 6 months ago

When ready, will fix gh-101

(edited)

ev-br commented 6 months ago

With cda3e8b94ee798b276c213a5a8c55949e7680556, gh-101 seems to be gone. EDIT: gone locally indeed; fails on CI though. A structural problem with test.__file__?

ev-br commented 6 months ago

Two things I do not understand ATM:

Sheila-nk commented 6 months ago

Two things I do not understand ATM:

  • the path to local files in test_testmod is clearly wrong. Why does TestLocalFiles pass with the doctest layer?
  • in test_pytest_configuration, who filled the local_resources dict of dt_config?

I believe the local_resources attribute is updated in the local_file_cases module here: https://github.com/ev-br/scpdt/blob/a79e6465b52a30b57db36dc4fa0ab3820ea08c37/scpdt/tests/local_file_cases.py#L5

However, the local files are typically located in the same directory as the module referencing them so the values should just be the names of the files:

dt_config.local_resources = {'scpdt.tests.local_file_cases.local_files':
                                  ['local_file.txt'],
                            'scpdt.tests.local_file_cases.sio':
                                  ['octave_a.mat']   
                                  }

I pulled this branch locally and this slight change seems to work.

ev-br commented 6 months ago

Could you send your changes as a PR for the CI to run?

Sheila-nk commented 6 months ago

Could you send your changes as a PR for the CI to run?

That seems to have done the trick: https://github.com/ev-br/scpdt/pull/127 Can I push the commit to this PR so that I can close the one I just created?

ev-br commented 6 months ago

Yup sure, if that's more convenient.

ev-br commented 6 months ago

Yup sure, if that's more convenient.

Actually, I'll cherry-pick it and squash my debug commits.

Sheila-nk commented 6 months ago

Yup sure, if that's more convenient.

Actually, I'll cherry-pick it and squash my debug commits.

😅 too late

ev-br commented 6 months ago

OK :-). Pulled, squashed, and pushed to here. CI is green.

ev-br commented 6 months ago

Merging in. Thank you Sheila for the fix!