Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use the non-depcrecated TextTestResult instead of _TextTestResult #333

Merged
merged 1 commit into from Nov 29, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 3 additions & 7 deletions test.py
Expand Up @@ -72,11 +72,7 @@
import unittest
import traceback

try:
# Python >=2.7 and >=3.2
from unittest.runner import _TextTestResult
except ImportError:
from unittest import _TextTestResult
from unittest import TextTestResult

__metaclass__ = type

Expand Down Expand Up @@ -307,14 +303,14 @@ def get_test_hooks(test_files, cfg, cov=None):
return results


class CustomTestResult(_TextTestResult):
class CustomTestResult(TextTestResult):
"""Customised TestResult.

It can show a progress bar, and displays tracebacks for errors and failures
as soon as they happen, in addition to listing them all at the end.
"""

__super = _TextTestResult
__super = TextTestResult
__super_init = __super.__init__
__super_startTest = __super.startTest
__super_stopTest = __super.stopTest
Expand Down