Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ jobs:
fail-fast: true

matrix:
os: [ubuntu-latest, macos-latest]
pyv: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
os: [ubuntu-latest]
pyv: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14","3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.8", "3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]

steps:
- uses: actions/checkout@v4
Expand All @@ -34,6 +34,7 @@ jobs:
python -m pip install -e .

- name: Test
timeout-minutes: 2
run: python -m pytest --cov-report=xml --cov=.

- name: Upload coverage to Codecov
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
pytest
pytest-asyncio
pytest-cov
mock-ssh-server
mock-ssh-server @ git+https://github.com/skshetry/mock-ssh-server.git@command-queue-race
importlib-metadata >= 6.0.0
20 changes: 18 additions & 2 deletions tests/test_sshfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
import tempfile
import warnings
from concurrent import futures
from datetime import datetime
from datetime import datetime, timedelta
from pathlib import Path

import fsspec
import pytest
from _pytest.python_api import ApproxBase
from asyncssh.sftp import SFTPFailure
from importlib_metadata import entry_points

Expand All @@ -17,7 +18,16 @@
_STATIC = (Path(__file__).parent / "static").resolve()
USERS = {"user": _STATIC / "user.key"}

DEVIATION = 5

class approx_datetime(ApproxBase):
def __init__(self, expected, abs=1):
super().__init__(expected, abs=timedelta(seconds=abs))

def __repr__(self):
return f"approx_datetime({self.expected!r} ± {self.abs!r})"

def __eq__(self, actual):
return abs(self.expected - actual) <= self.abs


@pytest.fixture(scope="session")
Expand Down Expand Up @@ -128,6 +138,12 @@ def test_move(fs, remote_dir):

initial_info.pop("name")
secondary_info.pop("name")
assert initial_info.pop("time") == approx_datetime(
secondary_info.pop("time")
)
assert initial_info.pop("mtime") == approx_datetime(
secondary_info.pop("mtime")
)
assert initial_info == secondary_info


Expand Down