hhatto / autopep8

A tool that automatically formats Python code to conform to the PEP 8 style guide.
https://pypi.org/project/autopep8/
MIT License
4.54k stars 291 forks source link

Ignore DeprecationWarnings to fix tests on py3.11 #665

Closed mgorny closed 1 year ago

mgorny commented 1 year ago

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.

mgorny commented 1 year ago

Thank you!