Patchwork test-bdiff: move import inside the function to avoid test failure

login
register
mail settings
Submitter Pulkit Goyal
Date Feb. 13, 2017, 8:29 p.m.
Message ID <a099a0633b39efcac1a8.1487017788@pulkit-goyal>
Download mbox | patch
Permalink /patch/18456/
State Accepted
Headers show

Comments

Pulkit Goyal - Feb. 13, 2017, 8:29 p.m.
# HG changeset patch
# User Pulkit Goyal <7895pulkit@gmail.com>
# Date 1487017336 -19800
#      Tue Feb 14 01:52:16 2017 +0530
# Node ID a099a0633b39efcac1a8c1e018e5bc284f0b00a3
# Parent  437f594e299aa68682783223e8fe60da230ee4a1
test-bdiff: move import inside the function to avoid test failure

test-check-module-imports.t fails on some systems where the path of home
directories is different than sys.prefix and sys.exec_prefix.
Importing silenttestrunner will help avoiding that failure.
Augie Fackler - Feb. 13, 2017, 10:29 p.m.
On Tue, Feb 14, 2017 at 01:59:48AM +0530, Pulkit Goyal wrote:
> # HG changeset patch
> # User Pulkit Goyal <7895pulkit@gmail.com>
> # Date 1487017336 -19800
> #      Tue Feb 14 01:52:16 2017 +0530
> # Node ID a099a0633b39efcac1a8c1e018e5bc284f0b00a3
> # Parent  437f594e299aa68682783223e8fe60da230ee4a1
> test-bdiff: move import inside the function to avoid test failure

lgtm, but can one of the people that observed this report back if it
fixes your problem?

Thanks!

>
> test-check-module-imports.t fails on some systems where the path of home
> directories is different than sys.prefix and sys.exec_prefix.
> Importing silenttestrunner will help avoiding that failure.
>
> diff -r 437f594e299a -r a099a0633b39 tests/test-bdiff.py
> --- a/tests/test-bdiff.py	Mon Feb 13 22:15:28 2017 +0530
> +++ b/tests/test-bdiff.py	Tue Feb 14 01:52:16 2017 +0530
> @@ -3,8 +3,6 @@
>  import struct
>  import unittest
>
> -import silenttestrunner
> -
>  from mercurial import (
>      bdiff,
>      mpatch,
> @@ -148,4 +146,5 @@
>                           ['a\n', diffreplace(2, 10, 'a\na\na\na\n', '')])
>
>  if __name__ == '__main__':
> +    import silenttestrunner
>      silenttestrunner.main(__name__)
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
via Mercurial-devel - Feb. 13, 2017, 10:49 p.m.
On Mon, Feb 13, 2017 at 2:29 PM, Augie Fackler <raf@durin42.com> wrote:

> On Tue, Feb 14, 2017 at 01:59:48AM +0530, Pulkit Goyal wrote:
> > # HG changeset patch
> > # User Pulkit Goyal <7895pulkit@gmail.com>
> > # Date 1487017336 -19800
> > #      Tue Feb 14 01:52:16 2017 +0530
> > # Node ID a099a0633b39efcac1a8c1e018e5bc284f0b00a3
> > # Parent  437f594e299aa68682783223e8fe60da230ee4a1
> > test-bdiff: move import inside the function to avoid test failure
>
> lgtm, but can one of the people that observed this report back if it
> fixes your problem?
>

Yup, fixes it for me :)


>
> Thanks!
>
> >
> > test-check-module-imports.t fails on some systems where the path of home
> > directories is different than sys.prefix and sys.exec_prefix.
> > Importing silenttestrunner will help avoiding that failure.
> >
> > diff -r 437f594e299a -r a099a0633b39 tests/test-bdiff.py
> > --- a/tests/test-bdiff.py     Mon Feb 13 22:15:28 2017 +0530
> > +++ b/tests/test-bdiff.py     Tue Feb 14 01:52:16 2017 +0530
> > @@ -3,8 +3,6 @@
> >  import struct
> >  import unittest
> >
> > -import silenttestrunner
> > -
> >  from mercurial import (
> >      bdiff,
> >      mpatch,
> > @@ -148,4 +146,5 @@
> >                           ['a\n', diffreplace(2, 10, 'a\na\na\na\n',
> '')])
> >
> >  if __name__ == '__main__':
> > +    import silenttestrunner
> >      silenttestrunner.main(__name__)
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>
Augie Fackler - Feb. 13, 2017, 11:15 p.m.
> On Feb 13, 2017, at 17:49, Kyle Lippincott <spectral@google.com> wrote:
> 
> 
> 
> On Mon, Feb 13, 2017 at 2:29 PM, Augie Fackler <raf@durin42.com <mailto:raf@durin42.com>> wrote:
> On Tue, Feb 14, 2017 at 01:59:48AM +0530, Pulkit Goyal wrote:
> > # HG changeset patch
> > # User Pulkit Goyal <7895pulkit@gmail.com <mailto:7895pulkit@gmail.com>>
> > # Date 1487017336 -19800
> > #      Tue Feb 14 01:52:16 2017 +0530
> > # Node ID a099a0633b39efcac1a8c1e018e5bc284f0b00a3
> > # Parent  437f594e299aa68682783223e8fe60da230ee4a1
> > test-bdiff: move import inside the function to avoid test failure
> 
> lgtm, but can one of the people that observed this report back if it
> fixes your problem?
> 
> Yup, fixes it for me :)

Queued, thanks for the test.

>  
> 
> Thanks!
> 
> >
> > test-check-module-imports.t fails on some systems where the path of home
> > directories is different than sys.prefix and sys.exec_prefix.
> > Importing silenttestrunner will help avoiding that failure.
> >
> > diff -r 437f594e299a -r a099a0633b39 tests/test-bdiff.py
> > --- a/tests/test-bdiff.py     Mon Feb 13 22:15:28 2017 +0530
> > +++ b/tests/test-bdiff.py     Tue Feb 14 01:52:16 2017 +0530
> > @@ -3,8 +3,6 @@
> >  import struct
> >  import unittest
> >
> > -import silenttestrunner
> > -
> >  from mercurial import (
> >      bdiff,
> >      mpatch,
> > @@ -148,4 +146,5 @@
> >                           ['a\n', diffreplace(2, 10, 'a\na\na\na\n', '')])
> >
> >  if __name__ == '__main__':
> > +    import silenttestrunner
> >      silenttestrunner.main(__name__)
> > _______________________________________________
> > Mercurial-devel mailing list
> > Mercurial-devel@mercurial-scm.org <mailto:Mercurial-devel@mercurial-scm.org>
> > https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel <https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel>
> 
>

Patch

diff -r 437f594e299a -r a099a0633b39 tests/test-bdiff.py
--- a/tests/test-bdiff.py	Mon Feb 13 22:15:28 2017 +0530
+++ b/tests/test-bdiff.py	Tue Feb 14 01:52:16 2017 +0530
@@ -3,8 +3,6 @@ 
 import struct
 import unittest
 
-import silenttestrunner
-
 from mercurial import (
     bdiff,
     mpatch,
@@ -148,4 +146,5 @@ 
                          ['a\n', diffreplace(2, 10, 'a\na\na\na\n', '')])
 
 if __name__ == '__main__':
+    import silenttestrunner
     silenttestrunner.main(__name__)