Tests: pathlib used where appropriate
Also fixed various pylint errors and style issues.
This commit is contained in:
@@ -1,9 +1,9 @@
|
||||
import os
|
||||
import re
|
||||
import subprocess
|
||||
from pathlib import Path
|
||||
|
||||
import pytest
|
||||
|
||||
from unit.applications.lang.python import ApplicationPython
|
||||
from unit.option import option
|
||||
from unit.utils import findmnt
|
||||
@@ -24,10 +24,10 @@ def get_cgroup(app_name):
|
||||
|
||||
cgroup = f'/proc/{pid}/cgroup'
|
||||
|
||||
if not os.path.isfile(cgroup):
|
||||
if not Path(cgroup).is_file():
|
||||
pytest.skip(f'no cgroup at {cgroup}')
|
||||
|
||||
with open(cgroup, 'r') as f:
|
||||
with open(cgroup, 'r', encoding='utf-8') as f:
|
||||
return f.read().rstrip()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user