From d08382422cdc53ea240ec3f5df02224ca4da396a Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Tue, 6 Sep 2022 23:59:44 -0500 Subject: [PATCH 01/14] fixed toml parser ignoring style --- .../_configuration/toml_parsing.py | 23 +++++++++++-------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index d684a414..bbbfb02f 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -41,15 +41,20 @@ def parse_toml_option( except KeyError: raise UnrecognizedOption(f"Don't recognize option {opt}") from exc - if isinstance(action, argparse._StoreTrueAction): - if value is True: - return [action.option_strings[0]] - return [] - if isinstance(action, argparse._StoreAction): - if isinstance(value, int): - value = str(value) - return [action.option_strings[0], value] - return [] # pragma: no cover + if isinstance(action, argparse._StoreTrueAction): + if value is True: + return [action.option_strings[0]] + return [] + elif isinstance(action, argparse._StoreAction): + if isinstance(value, int): + value = str(value) + return [action.option_strings[0], value] + elif isinstance(action, argparse._ExtendAction): + if isinstance(value, str): + value = str(value) + return [action.option_strings[0], value] + else: + raise NotImplementedError def parse_toml_file( From 856b24817c16dd5cf0d9f246e941a65c7b24920d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 05:01:42 +0000 Subject: [PATCH 02/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- .../_configuration/toml_parsing.py | 26 +++++++++---------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index bbbfb02f..fb86c870 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -41,20 +41,20 @@ def parse_toml_option( except KeyError: raise UnrecognizedOption(f"Don't recognize option {opt}") from exc - if isinstance(action, argparse._StoreTrueAction): - if value is True: - return [action.option_strings[0]] - return [] - elif isinstance(action, argparse._StoreAction): - if isinstance(value, int): - value = str(value) - return [action.option_strings[0], value] - elif isinstance(action, argparse._ExtendAction): - if isinstance(value, str): - value = str(value) - return [action.option_strings[0], value] + if isinstance(action, argparse._StoreTrueAction): + if value is True: + return [action.option_strings[0]] + return [] + elif isinstance(action, argparse._StoreAction): + if isinstance(value, int): + value = str(value) + return [action.option_strings[0], value] + elif isinstance(action, argparse._ExtendAction): + if isinstance(value, str): + value = str(value) + return [action.option_strings[0], value] else: - raise NotImplementedError + raise NotImplementedError def parse_toml_file( From f63dc888167ea070bd6f0a30e0f16dcbb3ac4d34 Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Wed, 7 Sep 2022 03:10:12 -0500 Subject: [PATCH 03/14] added testing for style in toml --- tests/test_config.py | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) diff --git a/tests/test_config.py b/tests/test_config.py index f3461f2e..0df612ab 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -62,6 +62,42 @@ def test_valid_toml_two( assert not output.err +def test_toml_style( + capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch +) -> None: + """Test a correct toml with write = False.""" + monkeypatch.chdir(CONFIG_DATA / "valid_toml_two") + pydocstringformatter.run_docstring_formatter(["test_package"]) + # I am assuming the default style is "pep257" + default_output = capsys.readouterr() + assert default_output.out.endswith( + ''' +@@ -1,3 +1,2 @@ +-""" +-A docstring""" ++"""A docstring.""" + +''' + ) + + with open("pyproject.toml", "a", encoding="utf8") as file: + file.write("style = 'numpydoc'") + + pydocstringformatter.run_docstring_formatter(["test_package"]) + numpydoc_output = capsys.readouterr() + + assert numpydoc_output.out.endswith( + ''' +@@ -1,3 +1,3 @@ ++"""A docstring. + """ +-A docstring""" + +''' + ) + assert not numpydoc_output.err + + def test_invalid_toml(monkeypatch: pytest.MonkeyPatch) -> None: """Test an invalid toml file.""" monkeypatch.chdir(CONFIG_DATA / "invalid_toml") From 528f5f22a98137dbd327bc80427ab7675a27d40b Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Wed, 7 Sep 2022 05:04:05 -0500 Subject: [PATCH 04/14] fixed R1705 from linter and added no cover comment --- pydocstringformatter/_configuration/toml_parsing.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index fb86c870..f03f6313 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -3,6 +3,7 @@ import argparse import os import sys +from argparse import _ExtendAction, _StoreAction, _StoreTrueAction from typing import Any from pydocstringformatter._utils.exceptions import TomlParsingError, UnrecognizedOption @@ -41,20 +42,22 @@ def parse_toml_option( except KeyError: raise UnrecognizedOption(f"Don't recognize option {opt}") from exc - if isinstance(action, argparse._StoreTrueAction): + if isinstance(action, _StoreTrueAction): if value is True: return [action.option_strings[0]] return [] - elif isinstance(action, argparse._StoreAction): + + if isinstance(action, _StoreAction): if isinstance(value, int): value = str(value) return [action.option_strings[0], value] - elif isinstance(action, argparse._ExtendAction): + + if isinstance(action, _ExtendAction): if isinstance(value, str): value = str(value) return [action.option_strings[0], value] - else: - raise NotImplementedError + + raise NotImplementedError # pragma: no cover def parse_toml_file( From 48a29973c5faef1a078194f5c7ae791d845a0d88 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 10:05:16 +0000 Subject: [PATCH 05/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pydocstringformatter/_configuration/toml_parsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index f03f6313..607fae2c 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -57,7 +57,7 @@ def parse_toml_option( value = str(value) return [action.option_strings[0], value] - raise NotImplementedError # pragma: no cover + raise NotImplementedError # pragma: no cover def parse_toml_file( From d5819fbc75d7ce3feb76c8395fba2c743d2a30e5 Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Wed, 7 Sep 2022 13:25:32 -0400 Subject: [PATCH 06/14] Update pydocstringformatter/_configuration/toml_parsing.py Co-authored-by: Pierre Sassoulas --- pydocstringformatter/_configuration/toml_parsing.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index 607fae2c..0ce0ac54 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -3,7 +3,7 @@ import argparse import os import sys -from argparse import _ExtendAction, _StoreAction, _StoreTrueAction +from argparse import _ExtendAction, _StoreAction, _StoreTrueAction # type: ignore[attr-defined] from typing import Any from pydocstringformatter._utils.exceptions import TomlParsingError, UnrecognizedOption From e755c4ae67b13ecaf53d8c9c1a4870deaded8578 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 7 Sep 2022 17:25:56 +0000 Subject: [PATCH 07/14] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- pydocstringformatter/_configuration/toml_parsing.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index 0ce0ac54..c6f3e661 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -3,7 +3,11 @@ import argparse import os import sys -from argparse import _ExtendAction, _StoreAction, _StoreTrueAction # type: ignore[attr-defined] +from argparse import ( # type: ignore[attr-defined] + _ExtendAction, + _StoreAction, + _StoreTrueAction, +) from typing import Any from pydocstringformatter._utils.exceptions import TomlParsingError, UnrecognizedOption From 25ebff3aea2eb289b12c50d76c91a36063f3a09b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Thu, 8 Sep 2022 10:20:38 +0200 Subject: [PATCH 08/14] Style changes --- pydocstringformatter/_configuration/toml_parsing.py | 11 +++-------- tests/test_config.py | 2 +- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index c6f3e661..fccd2f3a 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -3,11 +3,6 @@ import argparse import os import sys -from argparse import ( # type: ignore[attr-defined] - _ExtendAction, - _StoreAction, - _StoreTrueAction, -) from typing import Any from pydocstringformatter._utils.exceptions import TomlParsingError, UnrecognizedOption @@ -46,17 +41,17 @@ def parse_toml_option( except KeyError: raise UnrecognizedOption(f"Don't recognize option {opt}") from exc - if isinstance(action, _StoreTrueAction): + if isinstance(action, argparse._StoreTrueAction): if value is True: return [action.option_strings[0]] return [] - if isinstance(action, _StoreAction): + if isinstance(action, argparse._StoreAction): if isinstance(value, int): value = str(value) return [action.option_strings[0], value] - if isinstance(action, _ExtendAction): + if isinstance(action, argparse._ExtendAction): # type: ignore[attr-defined] if isinstance(value, str): value = str(value) return [action.option_strings[0], value] diff --git a/tests/test_config.py b/tests/test_config.py index 0df612ab..37b75648 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -68,7 +68,7 @@ def test_toml_style( """Test a correct toml with write = False.""" monkeypatch.chdir(CONFIG_DATA / "valid_toml_two") pydocstringformatter.run_docstring_formatter(["test_package"]) - # I am assuming the default style is "pep257" + # We are assuming the default style is "pep257" default_output = capsys.readouterr() assert default_output.out.endswith( ''' From c16452b5da9a4e6b9cec2fbb5f8e650b965f1b8a Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Thu, 8 Sep 2022 19:02:55 -0500 Subject: [PATCH 09/14] implemented code review changes --- .../_configuration/toml_parsing.py | 2 - .../config/valid_toml_numpydoc/pyproject.toml | 3 ++ .../test_package/numpydoc_style.py | 1 + .../config/valid_toml_pep257/pyproject.toml | 3 ++ .../test_package/numpydoc_style.py | 1 + tests/test_config.py | 46 ++++--------------- 6 files changed, 18 insertions(+), 38 deletions(-) create mode 100644 tests/data/config/valid_toml_numpydoc/pyproject.toml create mode 120000 tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py create mode 100644 tests/data/config/valid_toml_pep257/pyproject.toml create mode 120000 tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index fccd2f3a..d29239da 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -52,8 +52,6 @@ def parse_toml_option( return [action.option_strings[0], value] if isinstance(action, argparse._ExtendAction): # type: ignore[attr-defined] - if isinstance(value, str): - value = str(value) return [action.option_strings[0], value] raise NotImplementedError # pragma: no cover diff --git a/tests/data/config/valid_toml_numpydoc/pyproject.toml b/tests/data/config/valid_toml_numpydoc/pyproject.toml new file mode 100644 index 00000000..a660220b --- /dev/null +++ b/tests/data/config/valid_toml_numpydoc/pyproject.toml @@ -0,0 +1,3 @@ +[tool.pydocstringformatter] +write = false +style = 'numpydoc' diff --git a/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py b/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py new file mode 120000 index 00000000..ad53065c --- /dev/null +++ b/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py @@ -0,0 +1 @@ +../../../../data/format/numpydoc/numpydoc_regression.py \ No newline at end of file diff --git a/tests/data/config/valid_toml_pep257/pyproject.toml b/tests/data/config/valid_toml_pep257/pyproject.toml new file mode 100644 index 00000000..fa2fb1d3 --- /dev/null +++ b/tests/data/config/valid_toml_pep257/pyproject.toml @@ -0,0 +1,3 @@ +[tool.pydocstringformatter] +write = false +style = 'pep257' diff --git a/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py b/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py new file mode 120000 index 00000000..ad53065c --- /dev/null +++ b/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py @@ -0,0 +1 @@ +../../../../data/format/numpydoc/numpydoc_regression.py \ No newline at end of file diff --git a/tests/test_config.py b/tests/test_config.py index 37b75648..d1772ed8 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -62,42 +62,6 @@ def test_valid_toml_two( assert not output.err -def test_toml_style( - capsys: pytest.CaptureFixture[str], monkeypatch: pytest.MonkeyPatch -) -> None: - """Test a correct toml with write = False.""" - monkeypatch.chdir(CONFIG_DATA / "valid_toml_two") - pydocstringformatter.run_docstring_formatter(["test_package"]) - # We are assuming the default style is "pep257" - default_output = capsys.readouterr() - assert default_output.out.endswith( - ''' -@@ -1,3 +1,2 @@ --""" --A docstring""" -+"""A docstring.""" - -''' - ) - - with open("pyproject.toml", "a", encoding="utf8") as file: - file.write("style = 'numpydoc'") - - pydocstringformatter.run_docstring_formatter(["test_package"]) - numpydoc_output = capsys.readouterr() - - assert numpydoc_output.out.endswith( - ''' -@@ -1,3 +1,3 @@ -+"""A docstring. - """ --A docstring""" - -''' - ) - assert not numpydoc_output.err - - def test_invalid_toml(monkeypatch: pytest.MonkeyPatch) -> None: """Test an invalid toml file.""" monkeypatch.chdir(CONFIG_DATA / "invalid_toml") @@ -291,3 +255,13 @@ def test_style_invalid_choice(self, capsys: pytest.CaptureFixture[str]) -> None: output = capsys.readouterr() assert not output.out assert "--style: invalid choice: 'invalid'" in output.err + + def test_style_in_toml(self, monkeypatch: pytest.MonkeyPatch) -> None: + """Test that the style argument works in the toml file.""" + monkeypatch.chdir(CONFIG_DATA / "valid_toml_numpydoc") + run = _Run(["test_package"]) + assert ["numpydoc"] == run.config.style + + monkeypatch.chdir(CONFIG_DATA / "valid_toml_pep257") + run = _Run(["test_package"]) + assert ["pep257"] == run.config.style From 974ef0ce2de33b5ed23f082d68108d01eaf8e01b Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Fri, 9 Sep 2022 16:03:54 -0500 Subject: [PATCH 10/14] added testing for multiple styles in toml --- .../config/valid_toml_numpydoc/test_package/numpydoc_style.py | 4 +++- .../config/valid_toml_pep257/test_package/numpydoc_style.py | 4 +++- tests/test_config.py | 4 ++++ 3 files changed, 10 insertions(+), 2 deletions(-) mode change 120000 => 100644 tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py mode change 120000 => 100644 tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py diff --git a/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py b/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py deleted file mode 120000 index ad53065c..00000000 --- a/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py +++ /dev/null @@ -1 +0,0 @@ -../../../../data/format/numpydoc/numpydoc_regression.py \ No newline at end of file diff --git a/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py b/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py new file mode 100644 index 00000000..d7842d37 --- /dev/null +++ b/tests/data/config/valid_toml_numpydoc/test_package/numpydoc_style.py @@ -0,0 +1,3 @@ +def func(): + """ + A docstring""" diff --git a/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py b/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py deleted file mode 120000 index ad53065c..00000000 --- a/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py +++ /dev/null @@ -1 +0,0 @@ -../../../../data/format/numpydoc/numpydoc_regression.py \ No newline at end of file diff --git a/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py b/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py new file mode 100644 index 00000000..d7842d37 --- /dev/null +++ b/tests/data/config/valid_toml_pep257/test_package/numpydoc_style.py @@ -0,0 +1,3 @@ +def func(): + """ + A docstring""" diff --git a/tests/test_config.py b/tests/test_config.py index d1772ed8..10a96ee7 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -265,3 +265,7 @@ def test_style_in_toml(self, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.chdir(CONFIG_DATA / "valid_toml_pep257") run = _Run(["test_package"]) assert ["pep257"] == run.config.style + + monkeypatch.chdir(CONFIG_DATA / "valid_toml_numpydoc_pep257") + run = _Run(["test_package"]) + assert all(x in run.config.style for x in ("pep257", "numpydoc")) From 86ef24f1707ec93af080fc0e968e25c836a36b13 Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Fri, 9 Sep 2022 17:39:31 -0500 Subject: [PATCH 11/14] added data for the former test --- tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml | 3 +++ .../valid_toml_numpydoc_pep257/test_package/numpydoc_style.py | 3 +++ 2 files changed, 6 insertions(+) create mode 100644 tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml create mode 100644 tests/data/config/valid_toml_numpydoc_pep257/test_package/numpydoc_style.py diff --git a/tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml b/tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml new file mode 100644 index 00000000..2436934e --- /dev/null +++ b/tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml @@ -0,0 +1,3 @@ +[tool.pydocstringformatter] +write = false +style = 'numpydoc,pep257' diff --git a/tests/data/config/valid_toml_numpydoc_pep257/test_package/numpydoc_style.py b/tests/data/config/valid_toml_numpydoc_pep257/test_package/numpydoc_style.py new file mode 100644 index 00000000..d7842d37 --- /dev/null +++ b/tests/data/config/valid_toml_numpydoc_pep257/test_package/numpydoc_style.py @@ -0,0 +1,3 @@ +def func(): + """ + A docstring""" From 8896dcc8da62e9903082abf36000abf7565b1511 Mon Sep 17 00:00:00 2001 From: "J. Sebastian Paez" Date: Sat, 10 Sep 2022 02:44:30 -0500 Subject: [PATCH 12/14] added correct handling of extend actions in parser --- pydocstringformatter/_configuration/toml_parsing.py | 9 ++++++++- .../config/valid_toml_numpydoc_pep257/pyproject.toml | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pydocstringformatter/_configuration/toml_parsing.py b/pydocstringformatter/_configuration/toml_parsing.py index d29239da..65b8c036 100644 --- a/pydocstringformatter/_configuration/toml_parsing.py +++ b/pydocstringformatter/_configuration/toml_parsing.py @@ -52,7 +52,14 @@ def parse_toml_option( return [action.option_strings[0], value] if isinstance(action, argparse._ExtendAction): # type: ignore[attr-defined] - return [action.option_strings[0], value] + out_args = [] + if isinstance(value, list): + for item in value: + out_args += [action.option_strings[0], item] + else: + out_args = [action.option_strings[0], value] + + return out_args raise NotImplementedError # pragma: no cover diff --git a/tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml b/tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml index 2436934e..33b3dbd2 100644 --- a/tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml +++ b/tests/data/config/valid_toml_numpydoc_pep257/pyproject.toml @@ -1,3 +1,3 @@ [tool.pydocstringformatter] write = false -style = 'numpydoc,pep257' +style = ["numpydoc","pep257"] From 64670a43c5caa8541b93aefaaa06759a9cab48fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 10 Sep 2022 10:27:34 +0200 Subject: [PATCH 13/14] Apply suggestions from code review --- tests/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index 10a96ee7..a10bac07 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -268,4 +268,4 @@ def test_style_in_toml(self, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.chdir(CONFIG_DATA / "valid_toml_numpydoc_pep257") run = _Run(["test_package"]) - assert all(x in run.config.style for x in ("pep257", "numpydoc")) + assert run.config.style == ["pep257", "numpydoc"] From f4ee7067ed5582782b5479ada3a90d91c1090ce9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dani=C3=ABl=20van=20Noord?= <13665637+DanielNoord@users.noreply.github.com> Date: Sat, 10 Sep 2022 10:29:04 +0200 Subject: [PATCH 14/14] Apply suggestions from code review --- tests/test_config.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/test_config.py b/tests/test_config.py index a10bac07..9e6a07d1 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -268,4 +268,4 @@ def test_style_in_toml(self, monkeypatch: pytest.MonkeyPatch) -> None: monkeypatch.chdir(CONFIG_DATA / "valid_toml_numpydoc_pep257") run = _Run(["test_package"]) - assert run.config.style == ["pep257", "numpydoc"] + assert run.config.style == ["numpydoc", "pep257"]