From 98bd6eb3bd335f96a01d1d8cc05504f80e1aa492 Mon Sep 17 00:00:00 2001 From: Rehan Khwaja Date: Sun, 19 Nov 2023 21:14:55 -0800 Subject: [PATCH] Add workaround from pyfatfs --- pyproject.toml | 4 ++-- tests/test_dropboxfs.py | 11 ++++++++++- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index fe47e07..7a9ad23 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [tool.poetry] name = "fs.dropboxfs" -version = "1.0.1" +version = "1.0.2" description = "Pyfilesystem2 implementation for Dropbox" authors = ["Rehan Khwaja "] license = "MIT" @@ -47,7 +47,7 @@ pytest -n 8 || exit 1 [tool.ruff] line-length = 1000 -ignore = ["ANN", "B011", "COM812", "D", "DTZ", "EM", "ERA001", "FBT002", "FIX", "G004", "I", "N802", "N806", "N816", "PLR0913", "PTH", "S101", "T201", "TD", "TRY003", "W191"] +ignore = ["ANN", "B011", "COM812", "D", "DTZ", "EM", "ERA001", "FBT002", "FIX", "G004", "I", "N802", "N806", "N815", "N816", "PLR0913", "PTH", "S101", "T201", "TD", "TRY003", "W191"] select = ["ALL"] target-version = "py38" diff --git a/tests/test_dropboxfs.py b/tests/test_dropboxfs.py index 40bce4e..4d956f6 100644 --- a/tests/test_dropboxfs.py +++ b/tests/test_dropboxfs.py @@ -22,7 +22,16 @@ def FullFS(): credentials = LoadCredentials() return DropboxFS(refresh_token=credentials.get('refresh_token'), app_key=credentials.get('app_key'), app_secret=credentials.get('app_secret')) -class TestDropboxFS(FSTestCases, TestCase): +class PyFsCompatLayer: + """PyFilesystem2 Python 3.12 compatibility layer. + + Adds a workaround for PyFilesystem2#568: + https://github.com/PyFilesystem/pyfilesystem2/issues/568 + """ + + assertRaisesRegexp = TestCase.assertRaisesRegex + +class TestDropboxFS(FSTestCases, TestCase, PyFsCompatLayer): def make_fs(self): self.fullFS = FullFS() self.testSubdir = f'/tests/dropboxfs-test-{uuid4()}'