Debian Codegraph @

tests/conftest.py

raw
1 # -*- coding: utf-8 -*-
2 # coding=utf-8
3 # --------------------------------------------------------------------------
4 # Copyright (c) Microsoft Corporation. All rights reserved.
5 # Licensed under the MIT License. See License.txt in the project root for
6 # license information.
7 # --------------------------------------------------------------------------
8
9 import pytest
10
11 from azure.datalake.store import AzureDLFileSystem
12 from tests import settings
13 from tests.testing import working_dir
14
15
16 @pytest.fixture(scope="session", autouse=True)
17 def setup_env(request):
18 home = working_dir()
19 fs = AzureDLFileSystem(store_name=settings.STORE_NAME, token_credential=settings.TOKEN_CREDEDENTIAL)
20 if settings.RECORD_MODE != 'none':
21 if not fs.exists(home):
22 fs.mkdir(home)
23 else:
24 fs.rm(home, recursive=True)
25 fs.mkdir(home)