8000 TST: filter ImportWarnings in NoseTester. by rgommers · Pull Request #251 · numpy/numpy · GitHub
[go: up one dir, main page]

Skip to content

TST: filter ImportWarnings in NoseTester. #251

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

Merged
merged 1 commit into from
Apr 15, 2012

Conversation

rgommers
Copy link
Member

Warnings show up when a directory with the same name as a Python file or
compiled extension is seen which doesn't have an init.py file in it. This
situation is very common, for example in SciPy where many extensions are
created from source files located under a directory with the same name.

This filter is located within a context manager, so only filters when running
tests.

See thread http://mail.python.org/pipermail/python-dev/2006-June/066364.html for history.

Warnings show up when a directory with the same name as a Python file or
compiled extension is seen which doesn't have an __init__.py file in it.  This
situation is very common, for example in SciPy where many extensions are
created from source files located under a directory with the same name.

This filter is located within a context manager, so only filters when running
tests.
@stefanv
Copy link
Contributor
stefanv commented Apr 14, 2012

Looks good to me.

@charris
Copy link
Member
charris commented Apr 15, 2012

Are any of the warning potentially useful?

@rgommers
Copy link
Member Author

None of the ones I'm seeing. I can't imagine a case where they would be useful.

@rgommers
Copy link
Member Author

They're all like this:

/Users/rgommers/Code/scipy/scipy/odr/__init__.py:82: ImportWarning: Not
importing directory '/Users/rgommers/Code/scipy/scipy/odr/odrpack': missing
__init__.py from odrpack import *

A bit braindead, Python should simply recognize that when there's a successful import of odrpack.so, we've not trying to import the directory with source files.

@charris
Copy link
Member
charris commented Apr 15, 2012

OK. In it goes.

charris added a commit that referenced this pull request Apr 15, 2012
TST: filter ImportWarnings in NoseTester.
@charris charris merged commit 913e55d into numpy:master Apr 15, 2012
@charris
Copy link
Member
charris commented Apr 15, 2012

Oops, ImportWarning is new in 2.5, not available in 2.4. How do you want to deal with that?

@rgommers
Copy link
Member Author

Hmm, sloppy. It should have been a bare except anyway, I just moved what was there without thinking enough.

@rgommers
Copy link
Member Author

And again replying to fast. I read it as ImportError (the other PR you just merged). I think here we can simply remove the category=ImportWarning part, it doesn't make a difference.

@charris
Copy link
Member
charris commented Apr 15, 2012

I put up pull request 253 with this and some rearrangement.

luyahan pushed a commit to plctlab/numpy that referenced this pull request Apr 25, 2024
feat Add vshl[q]_n_[s8|s16|s32|s64|u8|u16|u32|u64]
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.

3 participants
0