[PATCH 2 of 9] test-trusted.py: fix on PyPy

Augie Fackler durin42 at gmail.com
Sun Dec 26 09:39:32 CST 2010


On Dec 26, 2010, at 6:51 AM, Dan Villiom Podlaski Christiansen wrote:
> 
> # HG changeset patch
> # User Dan Villiom Podlaski Christiansen <danchr at gmail.com>
> # Date 1293200527 -3600
> # Node ID a37295adc5d962fd8ea86b4dc2472b0ad0f11deb
> # Parent  4233e0fb74d1d801ad2ce9e3f713a0ca4c8ba668
> test-trusted.py: fix on PyPy
> 
> The test previously did a few print statements without end-of-line
> followed by a write from the UI object. For some reason, PyPy
> consistently inserted a space one character later. Changing the print
> statements to include a newline fixes this.

This sounds like a bug in pypy to me. Do the pypy guys not agree?

> 
> diff --git a/tests/test-trusted.py b/tests/test-trusted.py
> --- a/tests/test-trusted.py
> +++ b/tests/test-trusted.py
> @@ -69,10 +69,10 @@ def testui(user='foo', group='bar', tuse
>         print '   ', name, '=', path
>     print 'untrusted'
>     for name, path in u.configitems('paths', untrusted=True):
> -        print '.',
> -        u.config('paths', name) # warning with debug=True
> -        print '.',
> -        u.config('paths', name, untrusted=True) # no warnings
> +        print '# debug warning'
> +        u.config('paths', name)
> +        print '# no warnings'
> +        u.config('paths', name, untrusted=True)
>         print name, '=', path
>     print
> 
> diff --git a/tests/test-trusted.py.out b/tests/test-trusted.py.out
> --- a/tests/test-trusted.py.out
> +++ b/tests/test-trusted.py.out
> @@ -3,64 +3,96 @@ trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # same user, different group
> trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # different user, same group
> Not trusting file .hg/hgrc from untrusted user abc, group bar
> trusted
>     global = /some/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # different user, same group, but we trust the group
> trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # different user, different group
> Not trusting file .hg/hgrc from untrusted user abc, group def
> trusted
>     global = /some/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # different user, different group, but we trust the user
> trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # different user, different group, but we trust the group
> trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # different user, different group, but we trust the user and the group
> trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # we trust all users
> # different user, different group
> @@ -68,8 +100,12 @@ trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # we trust all groups
> # different user, different group
> @@ -77,8 +113,12 @@ trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # we trust all users and groups
> # different user, different group
> @@ -86,8 +126,12 @@ trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # we don't get confused by users and groups with the same name
> # different user, different group
> @@ -95,8 +139,12 @@ Not trusting file .hg/hgrc from untruste
> trusted
>     global = /some/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # list of user names
> # different user, different group, but we trust the user
> @@ -104,8 +152,12 @@ trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # list of group names
> # different user, different group, but we trust the group
> @@ -113,8 +165,12 @@ trusted
>     global = /some/path
>     local = /another/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # Can't figure out the name of the user running this process
> # different user, different group
> @@ -122,8 +178,12 @@ Not trusting file .hg/hgrc from untruste
> trusted
>     global = /some/path
> untrusted
> -. . global = /some/path
> -. . local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +# no warnings
> +local = /another/path
> 
> # prints debug warnings
> # different user, different group
> @@ -132,9 +192,13 @@ trusted
> ignoring untrusted configuration option paths.local = /another/path
>     global = /some/path
> untrusted
> -. . global = /some/path
> -.ignoring untrusted configuration option paths.local = /another/path
> -. local = /another/path
> +# debug warning
> +# no warnings
> +global = /some/path
> +# debug warning
> +ignoring untrusted configuration option paths.local = /another/path
> +# no warnings
> +local = /another/path
> 
> # ui.readconfig sections
> quux
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel at selenic.com
> http://selenic.com/mailman/listinfo/mercurial-devel




More information about the Mercurial-devel mailing list