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

Helpers #35

Merged
merged 6 commits into from
Nov 1, 2024
Merged

Helpers #35

merged 6 commits into from
Nov 1, 2024

Conversation

mih
Copy link
Member

@mih mih commented Nov 1, 2024

The drop in coverage will be temporary. It is mostly caused by the fixtures that will be used heavily in the next PR.

mih added 5 commits November 1, 2024 08:56
This is a poor-man's datalad-save. We use this instead, because we do
not actually want to have the inner workings of the tests depend on the
very core of the functionality they are supposed to test.

This helper merely calls git-add and git-commit in direct succession.
For most practical applications is can immediately replace datalad-save,
and it is faster.
The fixtures

- `symlinks_supported`
- `skip_when_symlinks_not_supported`

simplified test implementations that needs to behave differently (or not
at all) when symlinks are not available on the filesystem the tests are
using.
This is a more flexible and more robust variant of the datalad-next
fixture `modified_dataset`, split into a test helper and the actual
fixture.

Unlike the datalad-next version, it does not require any datalad
commands to work, just plain Git.
This is no more than a wrapper around `shutil.rmtree()`, but with an
error handler that tries to set write permissions on error.

This is a common-enough fix needed on the windows platform that it
seems worth providing a helper for.

Legacy DataLad also has one, but it's implementation seems to be very
much stuck in Python 2 times.
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 83.62069% with 19 lines in your changes missing coverage. Please review.

Project coverage is 99.22%. Comparing base (45f5edd) to head (5a4541a).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
datalad_core/tests/fixtures.py 44.44% 14 Missing and 1 partial ⚠️
datalad_core/tests/utils.py 94.59% 1 Missing and 3 partials ⚠️
Additional details and impacted files
@@             Coverage Diff             @@
##              main      #35      +/-   ##
===========================================
- Coverage   100.00%   99.22%   -0.78%     
===========================================
  Files           54       58       +4     
  Lines         2335     2447     +112     
  Branches       162      175      +13     
===========================================
+ Hits          2335     2428      +93     
- Misses           0       15      +15     
- Partials         0        4       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mih mih merged commit b1f3202 into main Nov 1, 2024
9 checks passed
@mih mih deleted the helpers branch November 1, 2024 08:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants