Create WorkflowRun.timing namedtuple from the dict (#1587)

To stop non-deterministic dictionary ordering ruining our day on Python
3.5, create the namedtuple using the keys of the dictionary.
This commit is contained in:
Steve Kowalik
2020-06-27 11:56:04 +10:00
committed by GitHub
parent c84fad818a
commit 1879518e2b
+1 -1
View File
@@ -233,8 +233,8 @@ class WorkflowRun(github.GithubObject.CompletableGithubObject):
:calls: `GET /repos/:owner/:repo/actions/runs/:run_id/timing <https://developer.github.com/v3/actions/workflow-runs/>`_
:rtype: namedtuple with billable and run_duration_ms members
"""
timingdata = namedtuple("TimingData", ["billable", "run_duration_ms"])
headers, data = self._requester.requestJsonAndCheck("GET", self.url + "/timing")
timingdata = namedtuple("TimingData", data.keys())
return timingdata._make(data.values())
def _initAttributes(self):