Patchwork D8280: tests: make test-doctest.t module list match reality

login
register
mail settings
Submitter phabricator
Date March 13, 2020, 4:12 a.m.
Message ID <differential-rev-PHID-DREV-n3xliapf4ihnvwvrfvzb-req@mercurial-scm.org>
Download mbox | patch
Permalink /patch/45760/
State Superseded
Headers show

Comments

phabricator - March 13, 2020, 4:12 a.m.
spectral created this revision.
Herald added a subscriber: mercurial-devel.
Herald added a reviewer: hg-reviewers.

REPOSITORY
  rHG Mercurial

BRANCH
  default

REVISION DETAIL
  https://phab.mercurial-scm.org/D8280

AFFECTED FILES
  tests/test-doctest.py

CHANGE DETAILS




To: spectral, #hg-reviewers
Cc: mercurial-devel
phabricator - March 13, 2020, 5:06 a.m.
This revision now requires changes to proceed.
mharbison72 added a comment.
mharbison72 requested changes to this revision.


  It looks like test-run-tests.py and i18n/check-translation.py have a test too.  (Not sure if we care about them; I mostly care about Windows.)
  
  It also looks like dispatch.py can be dropped.  Presumably `mercurial.util` being duplicated (once with a `testtarget=...` and once without) is on purpose, but IDK what that does.

INLINE COMMENTS

> test-doctest.py:69
>  testmod('mercurial.pathutil')
> -testmod('mercurial.parser')
> +testmod('mercurial.posix')
>  testmod('mercurial.pycompat')

It looks like this needs to be conditionalized, like the Windows module test:

  --- c:/Users/Matt/hg/tests/test-doctest.py.out
  +++ c:/Users/Matt/hg/tests/test-doctest.py.err
  @@ -0,0 +1,8 @@
  +Traceback (most recent call last):
  +  File "c:\Users\Matt\hg\tests\test-doctest.py", line 69, in <module>
  +    testmod('mercurial.posix')
  +  File "c:\Users\Matt\hg\tests\test-doctest.py", line 36, in testmod
  +    __import__(name)
  +  File "c:\Users\Matt\hg\mercurial\posix.py", line 11, in <module>
  +    import fcntl
  +ImportError: No module named fcntl

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8280/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8280

To: spectral, #hg-reviewers, mharbison72
Cc: mharbison72, mercurial-devel
phabricator - March 13, 2020, 8:48 a.m.
marmoute added a comment.


  Should we try to move to some automatic detection of file with doctest? That would be more reliable.

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8280/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8280

To: spectral, #hg-reviewers, mharbison72
Cc: marmoute, mharbison72, mercurial-devel
phabricator - March 14, 2020, 2:32 a.m.
spectral added a comment.
spectral marked an inline comment as done.


  In D8280#123642 <https://phab.mercurial-scm.org/D8280#123642>, @marmoute wrote:
  
  > Should we try to move to some automatic detection of file with doctest? That would be more reliable.
  
  D8294 <https://phab.mercurial-scm.org/D8294>, though it got a bit complicated :)

REPOSITORY
  rHG Mercurial

CHANGES SINCE LAST ACTION
  https://phab.mercurial-scm.org/D8280/new/

REVISION DETAIL
  https://phab.mercurial-scm.org/D8280

To: spectral, #hg-reviewers, mharbison72
Cc: marmoute, mharbison72, mercurial-devel

Patch

diff --git a/tests/test-doctest.py b/tests/test-doctest.py
--- a/tests/test-doctest.py
+++ b/tests/test-doctest.py
@@ -49,12 +49,10 @@ 
     runner.summarize()
 
 
-testmod('mercurial.changegroup')
 testmod('mercurial.changelog')
 testmod('mercurial.cmdutil')
 testmod('mercurial.color')
 testmod('mercurial.config')
-testmod('mercurial.context')
 testmod('mercurial.dagparser', optionflags=doctest.NORMALIZE_WHITESPACE)
 testmod('mercurial.dispatch')
 testmod('mercurial.encoding')
@@ -65,25 +63,26 @@ 
 testmod('mercurial.match')
 testmod('mercurial.mdiff')
 testmod('mercurial.minirst')
+testmod('mercurial.parser')
 testmod('mercurial.patch')
 testmod('mercurial.pathutil')
-testmod('mercurial.parser')
+testmod('mercurial.posix')
 testmod('mercurial.pycompat')
-testmod('mercurial.revlog')
 testmod('mercurial.revlogutils.deltas')
 testmod('mercurial.revset')
 testmod('mercurial.revsetlang')
+testmod('mercurial.simplemerge')
 testmod('mercurial.smartset')
 testmod('mercurial.store')
 testmod('mercurial.subrepo')
-testmod('mercurial.templatefilters')
 testmod('mercurial.templater')
 testmod('mercurial.ui')
-testmod('mercurial.url')
 testmod('mercurial.util')
 testmod('mercurial.util', testtarget='platform')
 testmod('mercurial.utils.dateutil')
 testmod('mercurial.utils.stringutil')
+if os.name == 'nt':
+    testmod('mercurial.windows')
 testmod('hgext.convert.convcmd')
 testmod('hgext.convert.cvsps')
 testmod('hgext.convert.filemap')