[PATCH] tests: fixed test too dependent on actual exception wording

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

[PATCH] tests: fixed test too dependent on actual exception wording

Georges Racinet-2
# HG changeset patch
# User Georges Racinet <[hidden email]>
# Date 1550744590 -3600
#      Thu Feb 21 11:23:10 2019 +0100
# Node ID 4170f58a6145f75e71a711886daa7439c7d4bed6
# Parent  a87ca1d7e61df30f968f5b0ca1a1f846aef91cb9
# EXP-Topic test-null-byte-filename
tests: fixed test too dependent on actual exception wording

On one of the machines I use to run the tests prior to submission,
the default Python is 2.7.5, with the following wording:

  must be encoded string without NULL bytes, not str

This third form (and possible future ones) are motivation to
use a wider catching regexp.

diff -r a87ca1d7e61d -r 4170f58a6145 tests/test-remotefilelog-gc.t
--- a/tests/test-remotefilelog-gc.t Mon Feb 11 16:34:48 2019 +0300
+++ b/tests/test-remotefilelog-gc.t Thu Feb 21 11:23:10 2019 +0100
@@ -108,6 +108,5 @@
 
   $ printf "asdas\0das" >> $CACHEDIR/repos
   $ hg gc
-  abort: invalid path asdas\x00da: stat: embedded null character in path (esc) (py3 !)
-  abort: invalid path asdas\x00da: stat() argument 1 must be encoded string without null bytes, not str (esc) (no-py3 !)
+  abort: invalid path asdas\x00da: .*(null|NULL).* (re)
   [255]
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel
Reply | Threaded
Open this post in threaded view
|

Re: [PATCH] tests: fixed test too dependent on actual exception wording

Yuya Nishihara
On Thu, 21 Feb 2019 12:13:58 +0100, Georges Racinet wrote:
> # HG changeset patch
> # User Georges Racinet <[hidden email]>
> # Date 1550744590 -3600
> #      Thu Feb 21 11:23:10 2019 +0100
> # Node ID 4170f58a6145f75e71a711886daa7439c7d4bed6
> # Parent  a87ca1d7e61df30f968f5b0ca1a1f846aef91cb9
> # EXP-Topic test-null-byte-filename
> tests: fixed test too dependent on actual exception wording

Queued, thanks.
_______________________________________________
Mercurial-devel mailing list
[hidden email]
https://www.mercurial-scm.org/mailman/listinfo/mercurial-devel