Skip to content

Commit

Permalink
Fix broken sort for pyexits
Browse files Browse the repository at this point in the history
  • Loading branch information
MassimoGirondi authored and tbarbette committed Jun 28, 2024
1 parent 6f3bb8d commit 9713889
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion npf/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,7 @@ def get_scripts(self) -> List[SectionScript]:
return self.scripts

def get_pyexits(self) -> List[SectionPyExit]:
self.pyexits.sort(key=lambda p: f"{p.name}_{p.index}")
return self.pyexits

def __init__(self, test_path, options, tags=None, role=None, inline=None):
Expand Down Expand Up @@ -929,7 +930,7 @@ def execute(self, build, run, v, n_runs=1, n_retry=0, allowed_types=SectionScrip
all_pyexits = []
all_pyexits_v = []
for s,vlist in [(t.testie,t.imp_v) for t in self.imports] + [(self, v)]:
for p in sorted(s.get_pyexits()):
for p in s.get_pyexits():
all_pyexits.append(p)
all_pyexits_v.append(vlist)

Expand Down

0 comments on commit 9713889

Please sign in to comment.