STINNER Victor added the comment:

> I can't reproduce the failure on Linux.

Do you have a 64-bit system? imageop is only built on 32-bit systems...

> Looks like a test ordering issue. When test_imageop runs before 
> test_py3kwarn, the warning has presumably already been shown once and so 
> isn't triggered when the test is looking for it (compare build 3092 linked 
> above with 3093, which passed).

Yes, I already investigated this issue and I found the same root cause. 

A Python module implemented in C like imageop cannot be reloaded twice. In 
fact, it can never be unloaded. Since the warning is emited when the module is 
loaded, the warning will only be emited once.

The issue is not specific to imageop: test_optional_module_removals() must fail 
on any module implemented in C if the module was already loaded before the test 
is executed.

> Either way, I'm about ready to just skip testing the warning for that module 
> on Windows.

The correct fix is to skip the test if the module was already loaded and if the 
module is implemented in C.

Attached patch implements this fix. I don't know how to test if a module is 
implemented in C or not. I chose to check if its filename ends with ".py" (or 
.pyc or .pyo).

----------
keywords: +patch
nosy: +haypo
Added file: http://bugs.python.org/file40331/test_py3kwarn.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue23375>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to