Patchwork [1,of,2,pypy] Fix failing test files with Pypy5.6.0

login
register
mail settings
Submitter Boris Feld
Date July 31, 2017, 3:46 p.m.
Message ID <9dfca91aab1f705652be.1501515970@FB>
Download mbox | patch
Permalink /patch/22587/
State Accepted
Headers show

Comments

Boris Feld - July 31, 2017, 3:46 p.m.
# HG changeset patch
# User Boris Feld <boris.feld@octobus.net>
# Date 1501515825 -7200
#      Mon Jul 31 17:43:45 2017 +0200
# Branch stable
# Node ID 9dfca91aab1f705652beeb9c29d213d8ff8b25aa
# Parent  025017423e532037e470e3e5e9b845cba5c4e710
# EXP-Topic pypy5.6.0-compat
Fix failing test files with Pypy5.6.0

Pypy 5.6.0 saves cached bytecode files in __pycache__ directory, clean them in
tests to fix loading old test extensions code.

Doing so should also helps for Python3.x migration.

Patch

diff -r 025017423e53 -r 9dfca91aab1f tests/test-commandserver.t
--- a/tests/test-commandserver.t	Fri Jul 21 10:46:31 2017 -0400
+++ b/tests/test-commandserver.t	Mon Jul 31 17:43:45 2017 +0200
@@ -234,7 +234,9 @@ 
   *** runcommand --config hooks.pre-identify=python:hook.hook id
   eff892de26ec tip
 
+Clean hook cached version
   $ rm hook.py*
+  $ rm -Rf __pycache__
 
   $ echo a >> a
   >>> import os
diff -r 025017423e53 -r 9dfca91aab1f tests/test-fncache.t
--- a/tests/test-fncache.t	Fri Jul 21 10:46:31 2017 -0400
+++ b/tests/test-fncache.t	Mon Jul 31 17:43:45 2017 +0200
@@ -270,7 +270,11 @@ 
   > cmdtable = {}
   > 
   > EOF
+
+Clean cached version
   $ rm -f "${extpath}c"
+  $ rm -Rf "$(dirname $extpath)/__pycache__"
+
   $ touch z
   $ hg ci -qAm z
   transaction abort!
@@ -305,7 +309,11 @@ 
   > cmdtable = {}
   > 
   > EOF
+
+Clean cached versions
   $ rm -f "${extpath}c"
+  $ rm -Rf "$(dirname $extpath)/__pycache__"
+
   $ hg up -q 1
   $ touch z
   $ hg ci -qAm z 2>/dev/null