con / con/fscacher

Consider making `fscacher.test` self-contained

Open
#100 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
2
Forks
2
PR merge metrics
No merged PRs in 30d

Description

I was trying to solve the issue discussed in https://bugs.debian.org/1079398#10 . For Debian's autopkgtest infra to work properly, the following patch will be needed, as discussed in https://lists.debian.org/debian-python/2024/11/msg00016.html :

```diff
--- fscacher-0.4.1.orig/src/fscacher/tests/test_cache.py
+++ fscacher-0.4.1/src/fscacher/tests/test_cache.py
@@ -8,8 +8,8 @@ import subprocess
import sys
import time
import pytest
-from .. import PersistentCache
-from ..cache import DirFingerprint, FileFingerprint
+from fscacher import PersistentCache
+from fscacher.cache import DirFingerprint, FileFingerprint

platform_system = platform.system().lower()
on_windows = platform_system == "windows"
--- fscacher-0.4.1.orig/src/fscacher/tests/test_util.py
+++ fscacher-0.4.1/src/fscacher/tests/test_util.py
@@ -1,5 +1,5 @@
import pytest
-from ..cache import xor_bytes
+from fscacher.cache import xor_bytes

@pytest.mark.parametrize(
```

I believe the logic is that tests should be self-contained, and not a subpackage under the `fscacher` namespace that utilizes relative import. Now I am wondering if that patch makes sense to you.

Besides, with this patch, the `/src/fscacher/tests/` directory can also be moved to the top dir and not nested under `/src/fscacher/`. That is just a wishlist item and you can decide whether that is useful.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.