Skip to content

Commit

Permalink
test: adjust flaky test which relies on filesystem permissions (#481)
Browse files Browse the repository at this point in the history
Signed-off-by: Nathan Nguyen <[email protected]>
  • Loading branch information
nathanwn authored Sep 22, 2023
1 parent bf118b3 commit fb302eb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tests/config/test_defaults.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,15 @@ def test_create_defaults() -> None:
"""Test dumping the default values."""
output_dir = os.path.dirname(os.path.abspath(__file__))
assert create_defaults(output_dir, global_config.macaron_path) is True
assert create_defaults("/", "/") is False


@pytest.mark.xfail(
os.geteuid() == 0,
reason="Only effective for non-root users",
)
def test_create_defaults_without_permission() -> None:
"""Test dumping default config in cases where the user does not have write permission to the output location."""
assert create_defaults(output_path="/", cwd_path="/") is False


@pytest.mark.parametrize(
Expand Down

0 comments on commit fb302eb

Please sign in to comment.