Description: Some test error codes would not work if run as root, hence skipping those tests
Author: Nilesh Patra <nilesh@debian.org>
Last-Update: 2022-08-28
--- a/tests/test_status.py
+++ b/tests/test_status.py
@@ -48,6 +48,7 @@
     # ]
 
 
+@pytest.mark.skipif(os.geteuid() == 0, reason="This test is meant to be run for normal user")
 def test_status_error_bad_permissions(capfd, test_dir_ys_bad_permissions):
     os.chdir(test_dir_ys_bad_permissions)
     ys = YARsync(["yarsync", "status"])
--- a/tests/test_ys_helpers.py
+++ b/tests/test_ys_helpers.py
@@ -152,6 +152,7 @@
     assert _substitute_env(lines).getvalue() == "[]\npath=$VAR1/maybe"
 
 
+@pytest.mark.skipif(os.geteuid() == 0, reason="This test is meant to be run for normal user")
 def test_error(test_dir_read_only):
     os.chdir(test_dir_read_only)
     ys = YARsync(["yarsync", "init"])
