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

Ignore DeprecationWarnings to fix tests on py3.11 #665

Merged
merged 2 commits into from
Mar 3, 2023

Conversation

mgorny
Copy link
Contributor

@mgorny mgorny commented Dec 16, 2022

Pass -Wignore::DeprecationWarning when spawning autopep8 in tests to fix the two test failures when running on Python 3.11:

======================================================================
FAIL: test_in_place_no_modifications_no_writes (__main__.CommandLineTests.test_in_place_no_modifications_no_writes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopep8/test/test_autopep8.py", line 5518, in test_in_place_no_modifications_no_writes
    self.assertEqual(err, b'')
AssertionError: b'/tmp/autopep8/autopep8.py:182: Deprecatio[137 chars]ze\n' != b''

======================================================================
FAIL: test_in_place_no_modifications_no_writes_with_empty_file (__main__.CommandLineTests.test_in_place_no_modifications_no_writes_with_empty_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopep8/test/test_autopep8.py", line 5530, in test_in_place_no_modifications_no_writes_with_empty_file
    self.assertEqual(err, b'')
AssertionError: b'/tmp/autopep8/autopep8.py:182: Deprecatio[137 chars]ze\n' != b''

This is a temporary fix until issue #581 is resolved.

Pass `-Wignore::DeprecationWarning` when spawning autopep8 in tests
to fix the two test failures when running on Python 3.11:

```
======================================================================
FAIL: test_in_place_no_modifications_no_writes (__main__.CommandLineTests.test_in_place_no_modifications_no_writes)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopep8/test/test_autopep8.py", line 5518, in test_in_place_no_modifications_no_writes
    self.assertEqual(err, b'')
AssertionError: b'/tmp/autopep8/autopep8.py:182: Deprecatio[137 chars]ze\n' != b''

======================================================================
FAIL: test_in_place_no_modifications_no_writes_with_empty_file (__main__.CommandLineTests.test_in_place_no_modifications_no_writes_with_empty_file)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/tmp/autopep8/test/test_autopep8.py", line 5530, in test_in_place_no_modifications_no_writes_with_empty_file
    self.assertEqual(err, b'')
AssertionError: b'/tmp/autopep8/autopep8.py:182: Deprecatio[137 chars]ze\n' != b''
```

This is a temporary fix until issue hhatto#581 is resolved.
@hhatto hhatto self-requested a review March 3, 2023 09:01
Copy link
Owner

@hhatto hhatto left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thx!!

@hhatto hhatto merged commit 0415bed into hhatto:main Mar 3, 2023
@mgorny
Copy link
Contributor Author

mgorny commented Mar 3, 2023

Thank you!

@mgorny mgorny deleted the 2to3-test branch March 3, 2023 12:16
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