Skip to content

Commit

Permalink
Fix test for compatibility with flake8 >=6
Browse files Browse the repository at this point in the history
  • Loading branch information
cp-bagerard committed Jan 25, 2023
1 parent 2037a8f commit d06748d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/github-actions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: [3.7, 3.8, 3.9, '3.10', 'pypy3.9']
python-version: [3.7, 3.8, 3.9, '3.10', pypy3.9]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
Expand Down
14 changes: 8 additions & 6 deletions test_flake8_test_name.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,18 +79,20 @@ def option_mgr(self):
prog="flake8",
version=flake8.__version__,
)
elif flake8.__version__ < "6":
return OptionManager(
version=flake8.__version__,
plugin_versions="",
parents=[],
)
else:
return OptionManager(
version=flake8.__version__,
plugin_versions="1.1.1",
plugin_versions="",
parents=[],
formatter_names=[],
)

def test__add_options__should_pass(self, option_mgr):
plugin = Flake8Argparse(None, SAMPLE_FILE_PATH)
plugin.add_options(option_mgr)
assert len(option_mgr.options) == 2

def test__parse_options__should_pass(self, option_mgr):
plugin = Flake8Argparse(None, SAMPLE_FILE_PATH)
args = SysArgs(
Expand Down

0 comments on commit d06748d

Please sign in to comment.