Cursiously, running the test alone works. But when ran from the whole class, it fails the first time. Another test may have side effect.
Commands:
# OK python -m pytest tests/old_functional.py::TestPermissionHierarchy2::test_sync_unshared_folder # Not OK python -m pytest tests/old_functional.py::TestPermissionHierarchy2