Skip to content

Commit

Permalink
fix(ci, python 3.12): use importlib_metadata for tests
Browse files Browse the repository at this point in the history
  • Loading branch information
shcheklein committed Jun 1, 2024
1 parent add6ead commit 64cc6ef
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ pytest
pytest-asyncio
pytest-cov
mock-ssh-server
importlib-metadata >= 6.0.0
6 changes: 3 additions & 3 deletions tests/test_sshfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
from pathlib import Path

import fsspec
import pkg_resources
import pytest
from asyncssh.sftp import SFTPFailure
from importlib_metadata import entry_points

from sshfs import SSHFileSystem

Expand Down Expand Up @@ -74,7 +74,7 @@ def strip_keys(info):


def test_fsspec_registration(ssh_server):
for ep in pkg_resources.iter_entry_points(group="fsspec.specs"):
for ep in list(entry_points(group="fsspec.specs")):
fs = fsspec.filesystem(
ep.name,
host=ssh_server.host,
Expand All @@ -86,7 +86,7 @@ def test_fsspec_registration(ssh_server):


def test_fsspec_url_parsing(ssh_server, remote_dir, user="user"):
for ep in pkg_resources.iter_entry_points(group="fsspec.specs"):
for ep in list(entry_points(group="fsspec.specs")):
url = f"{ep.name}://{user}@{ssh_server.host}:{ssh_server.port}/{remote_dir}/file"
with fsspec.open(url, "w", client_keys=[USERS[user]]) as file:
# Check the underlying file system.
Expand Down

0 comments on commit 64cc6ef

Please sign in to comment.