Skip to content

BUG: Fix small issues found with pytest-leaks - #18670

Merged
charris merged 1 commit into
numpy:mainfrom
seberg:small-pytest-leaks-fixes
Mar 23, 2021
Merged

charris merged 1 commit into
numpy:mainfrom
seberg:small-pytest-leaks-fixes

Conversation

@seberg

@seberg seberg commented Mar 23, 2021

Copy link
Copy Markdown
Member

None of these are particularly worrying as they either usually only
leak reference (and not memory) or appear in rare or almost impossible
error-paths, or are limited to the tests.

Unfortunately, this PR will not apply to 1.20.x, due to small changes
in the overrides.


The first override fix has to be done equivalently to the second one for backporting. I can open a backport PR once this is merged.

@seberg

seberg commented Mar 23, 2021

Copy link
Copy Markdown
Member Author

I had not done a good pytest-leaks in a while. I still got one running (since I restarted after I found these), so some small things might still crop up, although it doesn't have stop merging this.

@seberg seberg added the 09 - Backport-Candidate PRs tagged should be backported label Mar 23, 2021
@seberg
seberg force-pushed the small-pytest-leaks-fixes branch from 4ece8c1 to cc3f321 Compare March 23, 2021 19:57
Comment thread numpy/core/tests/test_overrides.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is causing problems on windows. Try data.tofile(tmp). Windows only allows a single process to access an open file and I suspect that is the problem.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! Well, I tried with TemporaryDirectory and just fixed the actual filename as a file inside that directory... That seems to work fine, lets see what windows thinks.
Maybe using tmp directly is nicer, but then I have to deal with seek(0) also...

None of these are particularly worrying as they either usually only
leak reference (and not memory) or appear in rare or almost impossible
error-paths, or are limited to the tests.

Unfortunately, this PR will not apply to 1.20.x, due to small changes
in the overrides.
@seberg
seberg force-pushed the small-pytest-leaks-fixes branch from cc3f321 to bbc07e7 Compare March 23, 2021 21:22
@charris
charris merged commit 2832caa into numpy:main Mar 23, 2021
@charris

charris commented Mar 23, 2021

Copy link
Copy Markdown
Member

Thanks Sebastian.

@seberg
seberg deleted the small-pytest-leaks-fixes branch March 23, 2021 22:46
seberg added a commit to seberg/numpy that referenced this pull request Mar 23, 2021
None of these are particularly worrying as they either usually only
leak reference (and not memory) or appear in rare or almost impossible
error-paths, or are limited to the tests.

Unfortunately, this PR will not apply to 1.20.x, due to small changes
in the overrides.

Backport of numpygh-18670 (with two small differences)
@charris charris removed the 09 - Backport-Candidate PRs tagged should be backported label Mar 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants