diff options
Diffstat (limited to 'meta-python/recipes-devtools/python/python3-python-dotenv')
| -rw-r--r-- | meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch b/meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch new file mode 100644 index 0000000000..154ab559a4 --- /dev/null +++ b/meta-python/recipes-devtools/python/python3-python-dotenv/0001-test_main.py-skip-two-test-when-running-as-root.patch | |||
| @@ -0,0 +1,39 @@ | |||
| 1 | From 68e4f05ece6b20e8a7d914d047185483373db759 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Jan Vermaete <jan.vermaete@gmail.com> | ||
| 3 | Date: Mon, 10 Nov 2025 18:04:27 +0100 | ||
| 4 | Subject: [PATCH 1/1] test_main.py: skip two test when running as root | ||
| 5 | |||
| 6 | Upstream-Status: Inappropriate [oe-specific] | ||
| 7 | |||
| 8 | The patch will only work for Linux and not for Windows. | ||
| 9 | And it's not common to run the tests of a Python module as root in the | ||
| 10 | not Yocto world. | ||
| 11 | |||
| 12 | Signed-off-by: Jan Vermaete <jan.vermaete@gmail.com> | ||
| 13 | --- | ||
| 14 | tests/test_main.py | 2 ++ | ||
| 15 | 1 file changed, 2 insertions(+) | ||
| 16 | |||
| 17 | diff --git a/tests/test_main.py b/tests/test_main.py | ||
| 18 | index 4496111..182bc33 100644 | ||
| 19 | --- a/tests/test_main.py | ||
| 20 | +++ b/tests/test_main.py | ||
| 21 | @@ -61,6 +61,7 @@ def test_set_key_encoding(dotenv_path): | ||
| 22 | assert dotenv_path.read_text(encoding=encoding) == "a='é'\n" | ||
| 23 | |||
| 24 | |||
| 25 | +@pytest.mark.skipif(os.geteuid() == 0, reason="Skipping becuase user is root") | ||
| 26 | def test_set_key_permission_error(dotenv_path): | ||
| 27 | dotenv_path.chmod(0o000) | ||
| 28 | |||
| 29 | @@ -167,6 +168,7 @@ def test_unset_encoding(dotenv_path): | ||
| 30 | assert dotenv_path.read_text(encoding=encoding) == "" | ||
| 31 | |||
| 32 | |||
| 33 | +@pytest.mark.skipif(os.geteuid() == 0, reason="Skipping becuase user is root") | ||
| 34 | def test_set_key_unauthorized_file(dotenv_path): | ||
| 35 | dotenv_path.chmod(0o000) | ||
| 36 | |||
| 37 | -- | ||
| 38 | 2.47.3 | ||
| 39 | |||
