Patchwork [2,of,2] tests: use require() instead of hghave in test-filecache.py

login
register
mail settings
Submitter Gregory Szorc
Date March 14, 2016, 12:50 a.m.
Message ID <98268939a6729a66814a.1457916656@ubuntu-vm-main>
Download mbox | patch
Permalink /patch/13859/
State Superseded
Headers show

Comments

Gregory Szorc - March 14, 2016, 12:50 a.m.
# HG changeset patch
# User Gregory Szorc <gregory.szorc@gmail.com>
# Date 1457916457 25200
#      Sun Mar 13 17:47:37 2016 -0700
# Node ID 98268939a6729a66814abf83b2271dafb48f609f
# Parent  7e524606e308bf43eb3e1385ed8f03fa42b6b67a
tests: use require() instead of hghave in test-filecache.py

This is much simpler, isn't it?
Gregory Szorc - March 14, 2016, 12:55 a.m.
Oops - test-check-pyflakes.t doesn't like this. Please discard.

On Sun, Mar 13, 2016 at 5:50 PM, Gregory Szorc <gregory.szorc@gmail.com>
wrote:

> # HG changeset patch
> # User Gregory Szorc <gregory.szorc@gmail.com>
> # Date 1457916457 25200
> #      Sun Mar 13 17:47:37 2016 -0700
> # Node ID 98268939a6729a66814abf83b2271dafb48f609f
> # Parent  7e524606e308bf43eb3e1385ed8f03fa42b6b67a
> tests: use require() instead of hghave in test-filecache.py
>
> This is much simpler, isn't it?
>
> diff --git a/tests/test-filecache.py b/tests/test-filecache.py
> --- a/tests/test-filecache.py
> +++ b/tests/test-filecache.py
> @@ -1,14 +1,11 @@
> -import sys, os, subprocess
> +require(['cacheable'])
>
> -if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'],
> -                    'cacheable']):
> -    sys.exit(80)
> -
> +import os
>  from mercurial import util, scmutil, extensions, hg, ui
>
>  filecache = scmutil.filecache
>
>  class fakerepo(object):
>      def __init__(self):
>          self._filecache = {}
>
>
Martin von Zweigbergk - March 14, 2016, 4:30 p.m.
When you get it to work, please update test-verify-repo-interactions.py as
well. I recently added a call to hghave there.

On Sun, Mar 13, 2016 at 5:55 PM Gregory Szorc <gregory.szorc@gmail.com>
wrote:

> Oops - test-check-pyflakes.t doesn't like this. Please discard.
>
> On Sun, Mar 13, 2016 at 5:50 PM, Gregory Szorc <gregory.szorc@gmail.com>
> wrote:
>
>> # HG changeset patch
>> # User Gregory Szorc <gregory.szorc@gmail.com>
>> # Date 1457916457 25200
>> #      Sun Mar 13 17:47:37 2016 -0700
>> # Node ID 98268939a6729a66814abf83b2271dafb48f609f
>> # Parent  7e524606e308bf43eb3e1385ed8f03fa42b6b67a
>> tests: use require() instead of hghave in test-filecache.py
>>
>> This is much simpler, isn't it?
>>
>> diff --git a/tests/test-filecache.py b/tests/test-filecache.py
>> --- a/tests/test-filecache.py
>> +++ b/tests/test-filecache.py
>> @@ -1,14 +1,11 @@
>> -import sys, os, subprocess
>> +require(['cacheable'])
>>
>> -if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'],
>> -                    'cacheable']):
>> -    sys.exit(80)
>> -
>> +import os
>>  from mercurial import util, scmutil, extensions, hg, ui
>>
>>  filecache = scmutil.filecache
>>
>>  class fakerepo(object):
>>      def __init__(self):
>>          self._filecache = {}
>>
>>
> _______________________________________________
> Mercurial-devel mailing list
> Mercurial-devel@mercurial-scm.org
> https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
>

Patch

diff --git a/tests/test-filecache.py b/tests/test-filecache.py
--- a/tests/test-filecache.py
+++ b/tests/test-filecache.py
@@ -1,14 +1,11 @@ 
-import sys, os, subprocess
+require(['cacheable'])
 
-if subprocess.call(['python', '%s/hghave' % os.environ['TESTDIR'],
-                    'cacheable']):
-    sys.exit(80)
-
+import os
 from mercurial import util, scmutil, extensions, hg, ui
 
 filecache = scmutil.filecache
 
 class fakerepo(object):
     def __init__(self):
         self._filecache = {}