remove common, too
authorVolker Birk <vb@pep.foundation>
Wed, 10 Jan 2018 15:09:42 +0100
changeset 2367bc21bd3fd514
parent 2364 083a82d2067f
child 2372 16dc3caf2156
child 2373 7c3290a4f26d
remove common, too
test/python_tests/conftest.py
test/python_tests/setup_test.py
     1.1 --- a/test/python_tests/conftest.py	Sat Jan 06 18:24:03 2018 +0100
     1.2 +++ b/test/python_tests/conftest.py	Wed Jan 10 15:09:42 2018 +0100
     1.3 @@ -8,5 +8,7 @@
     1.4  
     1.5  
     1.6  def pytest_runtest_setup(item):
     1.7 -    create_homes()
     1.8 -
     1.9 +    try:
    1.10 +        create_homes()
    1.11 +    except FileExistsError: # if concurrent process is already creating things
    1.12 +        pass
     2.1 --- a/test/python_tests/setup_test.py	Sat Jan 06 18:24:03 2018 +0100
     2.2 +++ b/test/python_tests/setup_test.py	Wed Jan 10 15:09:42 2018 +0100
     2.3 @@ -84,9 +84,11 @@
     2.4  
     2.5      try:
     2.6          os.stat("test1")
     2.7 -    except:
     2.8 +    except FileNotFoundError:
     2.9          create_home(mydir, "test1", "Alice One")
    2.10          create_home(mydir, "test2", "Bob Two")
    2.11 +        os.chdir(mydir);
    2.12 +        os.makedirs("common", exist_ok=True) # common inbox for Sync tests
    2.13      else:
    2.14          while True:
    2.15              try:
    2.16 @@ -104,6 +106,7 @@
    2.17      os.chdir(mydir)
    2.18      shutil.rmtree("test1", ignore_errors=True)
    2.19      shutil.rmtree("test2", ignore_errors=True)
    2.20 +    shutil.rmtree("common", ignore_errors=True)
    2.21      shutil.rmtree("__pycache__", ignore_errors=True)
    2.22  
    2.23