It's Riseup's twentieth year, help keep us going! If you can afford it, please contribute to our winter fundraising drive.

Commit 6e52661c authored by jvoisin's avatar jvoisin

Fix the testsuite on Python3.8

There is a bug in Python3.8 (https://bugs.python.org/issue38688)
triggering an infinite recursion when copying a tree
in a subfolder of the current one. We're working around it
by using a list instead of an iterator, so that Python
won't "discover" the target folder as part of the source files.

This should fix #130
parent 03f51299
Pipeline #30638 passed with stages
in 2 minutes and 11 seconds
import sys
import random
import os
import shutil
......@@ -258,7 +259,16 @@ class TestCommandLineParallel(unittest.TestCase):
os.remove(path)
def test_different(self):
shutil.copytree('./tests/data/', './tests/data/parallel')
src = './tests/data/'
dst = './tests/data/parallel'
if sys.version_info >= (3, 8):
with os.scandir(src) as itr:
entries = list(itr)
shutil._copytree(entries=entries, src=src, dst=dst, symlinks=False,
ignore=None, copy_function=shutil.copy2,
ignore_dangling_symlinks=False)
else:
shutil.copytree(src, dst)
proc = subprocess.Popen(mat2_binary + glob.glob('./tests/data/parallel/dirty.*'),
stdout=subprocess.PIPE)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment