Skip to content

Commit 1b3ce1b

Browse files
authored
Merge pull request #139 from pebenito/fix-ci-tests
Fix ci tests
2 parents 525cc90 + 0a713c6 commit 1b3ce1b

2 files changed

Lines changed: 8 additions & 6 deletions

File tree

setools/policyrep/typeattr.pxi

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,11 +107,11 @@ cdef class Type(BaseType):
107107

108108
stmt = f"type {self.name}"
109109
if count > 1:
110-
stmt += f" alias {{ {' '.join(self._aliases)} }}"
110+
stmt += f" alias {{ {' '.join(sorted(self._aliases))} }}"
111111
elif count == 1:
112112
stmt += f" alias {self._aliases[0]}"
113-
for attr in self._attrs:
114-
stmt += f", {attr}"
113+
if self._attrs:
114+
stmt += f", {', '.join(a.name for a in sorted(self._attrs))}"
115115
stmt += ";"
116116
return stmt
117117

tests/conftest.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,8 @@ def compiled_policy(request: pytest.FixtureRequest) -> Iterable[setools.SELinuxP
225225
args = marker.args if marker else ()
226226
kwargs = marker.kwargs if marker else {}
227227

228-
source_file = args[0]
228+
assert len(args) == 1
229+
source_file = args[0] # type: ignore
229230

230231
with tempfile.NamedTemporaryFile("w") as fd:
231232
yield _do_compile(source_file, fd.name, mls=kwargs.get("mls", True),
@@ -240,8 +241,9 @@ def policy_pair(request: pytest.FixtureRequest) -> \
240241
args = marker.args if marker else ()
241242
kwargs = marker.kwargs if marker else {}
242243

243-
source_file_left = args[0]
244-
source_file_right = args[1]
244+
assert len(args) == 2
245+
source_file_left = args[0] # type: ignore
246+
source_file_right = args[1] # type: ignore
245247

246248
with tempfile.NamedTemporaryFile("w") as fd_left:
247249
with tempfile.NamedTemporaryFile("w") as fd_right:

0 commit comments

Comments
 (0)