Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
pjbull committed Jul 28, 2024
1 parent 96a58ad commit 04f6664
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
25 changes: 15 additions & 10 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,12 @@ def _azure_fixture(conn_str_env_var, adls_gen2, request, monkeypatch, assets_dir

if live_server:
# Set up test assets
blob_service_client = BlobServiceClient.from_connection_string(
os.getenv(conn_str_env_var)
)
blob_service_client = BlobServiceClient.from_connection_string(os.getenv(conn_str_env_var))
data_lake_service_client = DataLakeServiceClient.from_connection_string(
os.getenv(conn_str_env_var)
)
test_files = [
f
for f in assets_dir.glob("**/*")
if f.is_file() and f.name not in UPLOAD_IGNORE_LIST
f for f in assets_dir.glob("**/*") if f.is_file() and f.name not in UPLOAD_IGNORE_LIST
]
for test_file in test_files:
blob_client = blob_service_client.get_blob_client(
Expand Down Expand Up @@ -163,10 +159,14 @@ def _azure_fixture(conn_str_env_var, adls_gen2, request, monkeypatch, assets_dir
drive=drive,
test_dir=test_dir,
live_server=live_server,
required_client_kwargs=dict(connection_string=os.getenv(conn_str_env_var)), # switch on/off adls gen2
required_client_kwargs=dict(
connection_string=os.getenv(conn_str_env_var)
), # switch on/off adls gen2
)

rig.client_class(connection_string=os.getenv(conn_str_env_var)).set_as_default_client() # set default client
rig.client_class(
connection_string=os.getenv(conn_str_env_var)
).set_as_default_client() # set default client

# add flag for adls gen2 rig to skip some tests
rig.is_adls_gen2 = adls_gen2
Expand All @@ -190,11 +190,16 @@ def _azure_fixture(conn_str_env_var, adls_gen2, request, monkeypatch, assets_dir

@fixture()
def azure_rig(request, monkeypatch, assets_dir):
yield from _azure_fixture("AZURE_STORAGE_CONNECTION_STRING", False, request, monkeypatch, assets_dir)
yield from _azure_fixture(
"AZURE_STORAGE_CONNECTION_STRING", False, request, monkeypatch, assets_dir
)


@fixture()
def azure_gen2_rig(request, monkeypatch, assets_dir):
yield from _azure_fixture("AZURE_STORAGE_GEN2_CONNECTION_STRING", True, request, monkeypatch, assets_dir)
yield from _azure_fixture(
"AZURE_STORAGE_GEN2_CONNECTION_STRING", True, request, monkeypatch, assets_dir
)


@fixture()
Expand Down
6 changes: 3 additions & 3 deletions tests/test_cloudpath_manipulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def test_joins(rig):


def test_with_segments(rig):
assert rig.create_cloud_path("a/b/c/d").with_segments(
"x", "y", "z"
) == rig.client_class(**rig.required_client_kwargs).CloudPath(f"{rig.cloud_prefix}x/y/z")
assert rig.create_cloud_path("a/b/c/d").with_segments("x", "y", "z") == rig.client_class(
**rig.required_client_kwargs
).CloudPath(f"{rig.cloud_prefix}x/y/z")


def test_is_junction(rig):
Expand Down

0 comments on commit 04f6664

Please sign in to comment.