-
Notifications
You must be signed in to change notification settings - Fork 50
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: patch missing Trial addDuration method in py312
- Loading branch information
1 parent
bea9394
commit a7f0160
Showing
2 changed files
with
15 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
if __name__ == "__main__": | ||
# Patch Twisted Trial's `_AdaptedReporter` to add the Python 3.12-expected `addDuration` method. | ||
# This eliminates a large amount of emitted warnings, and should no longer be necessary once | ||
# https://github.com/twisted/twisted/issues/12229 is fixed. | ||
import sys | ||
from twisted.trial.reporter import _AdaptedReporter | ||
from twisted.scripts.trial import run | ||
|
||
def _addDuration(self, _test, _elapsed): | ||
pass | ||
|
||
_AdaptedReporter.addDuration = _addDuration | ||
|
||
sys.exit(run()) |