test-duplicateoptions.py without inotify

Idan Kamara idankk86 at gmail.com
Mon Jun 27 08:34:57 CDT 2011


On Mon, Jun 27, 2011 at 2:14 AM, Mads Kiilerich <mads at kiilerich.com> wrote:

> Idan Kamara wrote, On 06/25/2011 09:19 AM:
>
>  On Sat, Jun 25, 2011 at 1:24 AM, Mads Kiilerich<mads at kiilerich.com>
>>  wrote:
>>
>>> The inotify extension is only available on few platforms. That causes
>>> test-duplicateoptions.py to fail on platforms such as Solaris:
>>> *** failed to import extension inotify: No module named inotify
>>>
>>> The failure can be simulated on linux with
>>> make local
>>> rm ./hgext/inotify/linux/_**inotify.so
>>> cd tests
>>> ./run-tests.py  -li test-duplicateoptions.py
>>>
>>
> (For the record: this failure is only seen with run-tests.py -l which uses
> 'make local' for the test.)
>
>
>  Idan, will you fix it somehow?
>>>
>> The error is written to stderr, so I guess this will do it:
>>
>> --- a/tests/test-duplicateoptions.**py    Fri Jun 24 23:25:42 2011 +0300
>> +++ b/tests/test-duplicateoptions.**py    Sat Jun 25 10:17:07 2011 +0300
>> @@ -17,6 +17,7 @@
>>  hgrc.close()
>>
>>  u = ui.ui()
>> +u.ferr = open(os.devnull, 'w')
>>  extensions.loadall(u)
>>
>>  for cmd, entry in commands.table.iteritems():
>>
>>
>> Or simply not load inotify. Unless someone has a better idea, I'll
>> send one of these.
>>
>
> We would like to test inotify on the platforms where it is available, so I
> guess '2> /dev/null' to mute the import failure is a fine solution as long
> as it doesn't mute other relevant warnings. Please send it as a 'real'
> patch.
>

inotify will still be tested, I just proposed to not try loading it in this
test.
I think it's a better workaround than muting stderr, since if some other
extension fails to load, we won't spot it. Also, inotify is pretty inactive
and doesn't really add any interesting command options.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://selenic.com/pipermail/mercurial-devel/attachments/20110627/1ee110b0/attachment.htm>


More information about the Mercurial-devel mailing list