Skip to content

Suppress DeprecationWarnings and prints when running tests - #131

Merged
JelleZijlstra merged 2 commits into
python:mainfrom
AlexWaygood:test-deprecations
Apr 9, 2023
Merged

JelleZijlstra merged 2 commits into
python:mainfrom
AlexWaygood:test-deprecations

Conversation

@AlexWaygood

Copy link
Copy Markdown
Member

If I run tests on main with Python 3.11, I get this output:

(venv) C:\Users\alexw\coding\typing_extensions>python src/test_typing_extensions.py
..............................................................C:\Users\alexw\coding\typing_extensions\src\test_typing_extensions.py:242: DeprecationWarning: A will go away soon
  A(42)
...........................................sssssssssssssssssss..................................................................................Runtime type is 'object'
..........................................C:\Users\alexw\coding\typing_extensions\src\test_typing_extensions.py:1962: DeprecationWarning: The kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.
  Emp = TypedDict('Emp', name=str, id=int)
........C:\Users\alexw\coding\typing_extensions\src\test_typing_extensions.py:2069: DeprecationWarning: The kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.
  EmpD = TypedDict('EmpD', name=str, id=int)
..C:\Users\alexw\coding\typing_extensions\src\test_typing_extensions.py:2047: DeprecationWarning: The kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.
  EmpD = TypedDict('EmpD', name=str, id=int)
....s.C:\Users\alexw\coding\typing_extensions\src\test_typing_extensions.py:1977: DeprecationWarning: The kwargs-based syntax for TypedDict definitions is deprecated in Python 3.11, will be removed in Python 3.13, and may not be understood by third-party type checkers.
  TD = TypedDict("TD", cls=type, self=object, typename=str, _typename=int,
........
----------------------------------------------------------------------
Ran 272 tests in 0.145s

OK (skipped=20)

With this PR, I get this output:

(venv) C:\Users\alexw\coding\typing_extensions>python src/test_typing_extensions.py
.........................................................................................................sssssssssssssssssss..........................................................................................................................................s.........
----------------------------------------------------------------------
Ran 272 tests in 0.131s

OK (skipped=20)

Comment thread src/test_typing_extensions.py Outdated
@JelleZijlstra
JelleZijlstra merged commit 6db3067 into python:main Apr 9, 2023
@AlexWaygood
AlexWaygood deleted the test-deprecations branch April 9, 2023 21:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants