File: test_sudo.py

package info (click to toggle)
python-plumbum 1.9.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,300 kB
  • sloc: python: 10,016; makefile: 130; sh: 8
file content (18 lines) | stat: -rw-r--r-- 430 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
from __future__ import annotations

import pytest

from plumbum import local
from plumbum._testtools import skip_on_windows

pytestmark = pytest.mark.sudo

# This is a separate file to make separating (ugly) sudo command easier
# For example, you can now run test_local directly without typing a password


class TestSudo:
    @skip_on_windows
    def test_as_user(self):
        with local.as_root():
            local["date"]()