Repository: ansible/ansible-navigator (language: python)

Issue:
Exempt macOS from a `/dev/queue` check when `podman` is the container engine
Skip the `/dev/mqueue` check when the sys.platform is darwin.

Fixes: #1243 


Discussion / hints:

Fix patch:
diff --git a/.flake8 b/.flake8
index af87b3910..14b375f1b 100644
--- a/.flake8
+++ b/.flake8
@@ -57,9 +57,7 @@ per-file-ignores =
   # S101: Allow the use of assert within the tests directory, since tests require it.
   tests/**.py: S101
 
-  # The following were present during the initial implementation.
-  # They are expected to be fixed and unignored over time.
-  src/ansible_navigator/app_public.py: D204, D205, D211, D400
+  # The tokenization code is vendored and not a priority for docstrings.
   src/ansible_navigator/tm_tokenize/__init__.py: D104
   src/ansible_navigator/tm_tokenize/compiler.py: D100, D101, D102
   src/ansible_navigator/tm_tokenize/fchainmap.py: D100, D101, D105
@@ -70,53 +68,44 @@ per-file-ignores =
   src/ansible_navigator/tm_tokenize/state.py: D100, D101, D102
   src/ansible_navigator/tm_tokenize/tokenize.py: D100, D201, D400, D403, DAR101, DAR201
   src/ansible_navigator/tm_tokenize/utils.py: D100, D400, D403, DAR101, DAR201
-#  src/ansible_navigator/ui_framework/curses_window.py: D200, D202, D205, D209, D400, D401, D403, DAR101, DAR201
-#  src/ansible_navigator/ui_framework/menu_builder.py: D200, D400, D401, D403, DAR101, DAR201
-#  src/ansible_navigator/ui_framework/sentinels.py: D102, D105, D205, D400
-  src/ansible_navigator/ui_framework/ui.py: D200, D202, D205, D211, D400, D403, DAR101, DAR201, DAR401
-#  src/ansible_navigator/ui_framework/utils.py: D200, D205, D400, D403, DAR101, DAR201
-  src/ansible_navigator/ui_framework/validators.py: D200, D400, D401, D403, DAR101, DAR201, DAR401
-  tests/__init__.py: D104
+
+  # The following were present during the initial implementation.
+  # They are expected to be fixed and unignored over time.
+  src/ansible_navigator/ui_framework/ui.py: D205, D211, D400, D403, DAR101, DAR201, DAR401
+  src/ansible_navigator/ui_framework/validators.py: D400, D401, D403, DAR101, DAR201, DAR401
   tests/conftest.py: D210, D400, D401, D403, DAR101, DAR201, DAR301, DAR401
-  tests/defaults.py: D200
-  tests/integration/__init__.py: D104
   tests/integration/_action_run_test.py: D205, D400, D401, D403, DAR101, DAR201, DAR401
-  tests/integration/_cli2runner.py: D200, D400, D401, D403, DAR101, DAR401
-  tests/integration/_common.py: D103, D200, D400, D401, D403, DAR101, DAR201, DAR401
-  tests/integration/_interactions.py: D200, D204, D400, D403, DAR101, DAR201
+  tests/integration/_cli2runner.py: D400, D401, D403, DAR101, DAR401
+  tests/integration/_common.py: D103, D400, D401, D403, DAR101, DAR201, DAR401
+  tests/integration/_interactions.py: D204, D400, D403, DAR101, DAR201
   tests/integration/_tmux_session.py: D105, D205, D400, D403, DAR101, DAR201, DAR401
-  tests/integration/actions/__init__.py: D104
   tests/integration/conftest.py: D205, D400, D401, D403, DAR101, DAR201, DAR301
-  tests/integration/test_stdout_exit_codes.py: D200, D400, D403, DAR101, DAR201
-  tests/unit/__init__.py: D104
-  tests/unit/actions/__init__.py: D104
+  tests/integration/test_stdout_exit_codes.py: D400, D403, DAR101, DAR201
   tests/unit/actions/collections/test_collection_doc_cache_path.py: D400, DAR101, DAR102, DAR201
-  tests/unit/actions/test_config.py: D200, D400, D403
-  tests/unit/actions/test_inventory.py: D200, D400, D403
-  tests/unit/actions/test_run.py: D200, D400, DAR101, DAR201
-  tests/unit/configuration_subsystem/__init__.py: D104
-  tests/unit/configuration_subsystem/conftest.py: D200, D400, D403, DAR101, DAR201
+  tests/unit/actions/test_config.py: D400, D403
+  tests/unit/actions/test_inventory.py: D400, D403
+  tests/unit/actions/test_run.py: D400, DAR101, DAR201
+  tests/unit/configuration_subsystem/conftest.py: D400, D403, DAR101, DAR201
   tests/unit/configuration_subsystem/data.py: D205, D400, D403, DAR101, DAR201
-  tests/unit/configuration_subsystem/defaults.py: D200, D400
-  tests/unit/configuration_subsystem/test_broken_settings.py: D200, D400, DAR101
-  tests/unit/configuration_subsystem/test_configurator.py: D200, D205, D209, D400, DAR101
-  tests/unit/configuration_subsystem/test_container_engine_auto.py: D200, DAR101
-  tests/unit/configuration_subsystem/test_entries_sanity.py: D200, D400, DAR101
+  tests/unit/configuration_subsystem/defaults.py: D400
+  tests/unit/configuration_subsystem/test_broken_settings.py: D400, DAR101
+  tests/unit/configuration_subsystem/test_configurator.py: D205, D209, D400, DAR101
+  tests/unit/configuration_subsystem/test_container_engine_auto.py: DAR101
+  tests/unit/configuration_subsystem/test_entries_sanity.py: D400, DAR101
   tests/unit/configuration_subsystem/test_fixture_sanity.py: D205, D400
-  tests/unit/configuration_subsystem/test_invalid_params.py: D200, D202, D400, DAR101
+  tests/unit/configuration_subsystem/test_invalid_params.py: D400, DAR101
   tests/unit/configuration_subsystem/test_mode_subcommand_action.py: D205, D400
   tests/unit/configuration_subsystem/test_precedence.py: D205, D400, DAR101
-  tests/unit/configuration_subsystem/test_previous_cli.py: D202, D205, D400
+  tests/unit/configuration_subsystem/test_previous_cli.py: D205, D400
   tests/unit/configuration_subsystem/test_sample_configurations.py: D205, D400
-  tests/unit/configuration_subsystem/utils.py: D200, D400, DAR101, DAR201
-  tests/unit/image_manager/__init__.py: D104
+  tests/unit/configuration_subsystem/utils.py: D400, DAR101, DAR201
   tests/unit/image_manager/test_image_puller.py: D400, D403, DAR101, DAR201
-  tests/unit/runner/test_api.py: D200, D202, D400, D403, DAR101
-  tests/unit/test_cli.py: D200, D202, D205, D400, D403, DAR101, DAR201
-  tests/unit/test_image_introspection.py: D200, D400, D403, DAR101, DAR201
-  tests/unit/test_log_append.py: D200, D400, D403, DAR101
-  tests/unit/ui_framework/test_colorize.py: D200, D205, D209, D400, DAR101
-  tests/unit/utils/test_functions.py: D200, D202, D400, D403, DAR101
+  tests/unit/runner/test_api.py: D400, D403, DAR101
+  tests/unit/test_cli.py: D205, D400, D403, DAR101, DAR201
+  tests/unit/test_image_introspection.py: D400, D403, DAR101, DAR201
+  tests/unit/test_log_append.py: D400, D403, DAR101
+  tests/unit/ui_framework/test_colorize.py: D205, D209, D400, DAR101
+  tests/unit/utils/test_functions.py: D400, D403, DAR101
 
 # Count the number of occurrences of each error/warning code and print a report:
 statistics = true
diff --git a/src/ansible_navigator/ui_framework/ui.py b/src/ansible_navigator/ui_framework/ui.py
index 4a0d00425..d33e639a0 100644
--- a/src/ansible_navigator/ui_framework/ui.py
+++ b/src/ansible_navigator/ui_framework/ui.py
@@ -1,6 +1,5 @@
 # cspell:ignore KEY_NPAGE, KEY_PPAGE
-"""the main UI renderer
-"""
+"""The main UI renderer."""
 import curses
 import logging
 import re
@@ -547,7 +546,6 @@ def _serialize_color(self, obj: Any) -> CursesLines:
         :type obj: Any
         :returns: The generated lines
         """
-
         if self.content_format() is ContentFormat.ANSI:
             return self._colorizer.render_ansi(doc=obj)
 
@@ -822,7 +820,6 @@ def _show_menu(self, current: Sequence[Any], columns: List, await_input: bool) -
         :param await_input: Should we wait for user input?
         :returns: Interaction with the user
         """
-
         while True:
 
             if self.scroll() == 0:
diff --git a/src/ansible_navigator/ui_framework/validators.py b/src/ansible_navigator/ui_framework/validators.py
index b59a1f498..4bc3cc27b 100644
--- a/src/ansible_navigator/ui_framework/validators.py
+++ b/src/ansible_navigator/ui_framework/validators.py
@@ -1,5 +1,4 @@
-"""predefined form field validators
-"""
+"""Predefined form field validators."""
 
 import os
 


Test patch:
diff --git a/tests/__init__.py b/tests/__init__.py
index e69de29bb..c9762d21b 100644
--- a/tests/__init__.py
+++ b/tests/__init__.py
@@ -0,0 +1,1 @@
+"""All tests."""
diff --git a/tests/defaults.py b/tests/defaults.py
index a01318b57..7e748be77 100644
--- a/tests/defaults.py
+++ b/tests/defaults.py
@@ -1,5 +1,4 @@
-"""Constants with default values used throughout the tests.
-"""
+"""Constants with default values used throughout the tests."""
 import os
 
 
diff --git a/tests/integration/__init__.py b/tests/integration/__init__.py
index e69de29bb..e176a8bc6 100644
--- a/tests/integration/__init__.py
+++ b/tests/integration/__init__.py
@@ -0,0 +1,1 @@
+"""The integration tests."""
diff --git a/tests/integration/_common.py b/tests/integration/_common.py
index bad3da4e3..5b140a82b 100644
--- a/tests/integration/_common.py
+++ b/tests/integration/_common.py
@@ -1,5 +1,4 @@
-"""some common functions for the tests
-"""
+"""Common functions for the tests."""
 import json
 import os
 import re
diff --git a/tests/integration/_interactions.py b/tests/integration/_interactions.py
index ed626ee2e..58189dd1c 100644
--- a/tests/integration/_interactions.py
+++ b/tests/integration/_interactions.py
@@ -1,5 +1,4 @@
-"""common classes to handle user interactions
-"""
+"""Common classes to handle user interactions."""
 import shlex
 
 from enum import Enum
diff --git a/tests/integration/test_stdout_exit_codes.py b/tests/integration/test_stdout_exit_codes.py
index 09c001bbd..9ff8a815b 100644
--- a/tests/integration/test_stdout_exit_codes.py
+++ b/tests/integration/test_stdout_exit_codes.py
@@ -1,5 +1,4 @@
-"""check return codes from mode ``stdout``
-"""
+"""Check return codes from mode ``stdout``."""
 import os
 import subprocess
 
diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py
index e69de29bb..f869ab279 100644
--- a/tests/unit/__init__.py
+++ b/tests/unit/__init__.py
@@ -0,0 +1,1 @@
+"""The unit tests."""
diff --git a/tests/unit/actions/__init__.py b/tests/unit/actions/__init__.py
index e69de29bb..d01ac9ae1 100644
--- a/tests/unit/actions/__init__.py
+++ b/tests/unit/actions/__init__.py
@@ -0,0 +1,1 @@
+"""Action specific unit tests."""
diff --git a/tests/unit/actions/test_config.py b/tests/unit/actions/test_config.py
index fa5619b17..bcac72d16 100644
--- a/tests/unit/actions/test_config.py
+++ b/tests/unit/actions/test_config.py
@@ -1,5 +1,4 @@
-"""Unit tests for the ``config`` action.
-"""
+"""Unit tests for the ``config`` action."""
 import curses
 
 from ansible_navigator.actions.config import color_menu
diff --git a/tests/unit/actions/test_inventory.py b/tests/unit/actions/test_inventory.py
index f67f9c08a..217d9ece3 100644
--- a/tests/unit/actions/test_inventory.py
+++ b/tests/unit/actions/test_inventory.py
@@ -1,5 +1,4 @@
-"""Unit tests for the inventory action.
-"""
+"""Unit tests for the inventory action."""
 import curses
 
 from ansible_navigator.actions.inventory import color_menu
diff --git a/tests/unit/configuration_subsystem/__init__.py b/tests/unit/configuration_subsystem/__init__.py
index e69de29bb..6bfa648a8 100644
--- a/tests/unit/configuration_subsystem/__init__.py
+++ b/tests/unit/configuration_subsystem/__init__.py
@@ -0,0 +1,1 @@
+"""Unit tests for the configuration subsystem."""
diff --git a/tests/unit/configuration_subsystem/conftest.py b/tests/unit/configuration_subsystem/conftest.py
index 80d928a84..47d7a6e19 100644
--- a/tests/unit/configuration_subsystem/conftest.py
+++ b/tests/unit/configuration_subsystem/conftest.py
@@ -1,5 +1,4 @@
-"""fixtures for configuration subsystem tests
-"""
+"""Fixtures for configuration subsystem tests."""
 import os
 
 from copy import deepcopy
diff --git a/tests/unit/configuration_subsystem/defaults.py b/tests/unit/configuration_subsystem/defaults.py
index 362db0055..0e4705f86 100644
--- a/tests/unit/configuration_subsystem/defaults.py
+++ b/tests/unit/configuration_subsystem/defaults.py
@@ -1,5 +1,4 @@
-"""defaults for adjacent tests
-"""
+"""Defaults for adjacent tests."""
 import os
 
 from ...defaults import FIXTURES_DIR
diff --git a/tests/unit/configuration_subsystem/test_broken_settings.py b/tests/unit/configuration_subsystem/test_broken_settings.py
index 3d9a06cda..d70e12ca8 100644
--- a/tests/unit/configuration_subsystem/test_broken_settings.py
+++ b/tests/unit/configuration_subsystem/test_broken_settings.py
@@ -1,5 +1,4 @@
-"""test using broken settings files
-"""
+"""Tests using broken settings files."""
 import os
 
 
diff --git a/tests/unit/configuration_subsystem/test_configurator.py b/tests/unit/configuration_subsystem/test_configurator.py
index 49271a466..11403d0c2 100644
--- a/tests/unit/configuration_subsystem/test_configurator.py
+++ b/tests/unit/configuration_subsystem/test_configurator.py
@@ -1,5 +1,4 @@
-"""Some tests directly for ``Configurator``
-"""
+"""Some tests directly for ``Configurator``."""
 import os
 
 from copy import deepcopy
diff --git a/tests/unit/configuration_subsystem/test_container_engine_auto.py b/tests/unit/configuration_subsystem/test_container_engine_auto.py
index 63be691e5..9b4209bdf 100644
--- a/tests/unit/configuration_subsystem/test_container_engine_auto.py
+++ b/tests/unit/configuration_subsystem/test_container_engine_auto.py
@@ -1,5 +1,4 @@
-"""Tests related to the auto detection of the container engine.
-"""
+"""Tests related to the auto detection of the container engine."""
 import shutil
 
 
diff --git a/tests/unit/configuration_subsystem/test_entries_sanity.py b/tests/unit/configuration_subsystem/test_entries_sanity.py
index 438e2f362..8dfa7faef 100644
--- a/tests/unit/configuration_subsystem/test_entries_sanity.py
+++ b/tests/unit/configuration_subsystem/test_entries_sanity.py
@@ -1,5 +1,4 @@
-"""perform some sanity and syntax checking of the navigator configuration
-"""
+"""Some sanity and syntax checking of the navigator configuration."""
 from collections import Counter
 
 import pytest
diff --git a/tests/unit/configuration_subsystem/test_invalid_params.py b/tests/unit/configuration_subsystem/test_invalid_params.py
index 63158f980..6820f4ebe 100644
--- a/tests/unit/configuration_subsystem/test_invalid_params.py
+++ b/tests/unit/configuration_subsystem/test_invalid_params.py
@@ -1,5 +1,4 @@
-"""Some test using invalid parameters
-"""
+"""Tests using invalid parameters."""
 import tempfile
 
 # pylint: disable=preferred-module  # FIXME: remove once migrated per GH-872
@@ -96,7 +95,6 @@ def test_badly_formatted_env_var(_mocked_func, generate_config):
 @patch("shutil.which", return_value="/path/to/container_engine")
 def test_not_a_bool(_mocked_func, generate_config):
     """Ensure exit_messages generated for wrong type of value"""
-
     response = generate_config(setting_file_name="ansible-navigator_not_bool.yml")
     exit_msg = "In 'ansible-navigator.execution-environment.enabled': 5 is not of type 'boolean'."
     assert exit_msg in [exit_msg.message for exit_msg in response.exit_messages]
diff --git a/tests/unit/configuration_subsystem/test_posix_message_queue.py b/tests/unit/configuration_subsystem/test_posix_message_queue.py
index 39b499f18..49a7ddd01 100644
--- a/tests/unit/configuration_subsystem/test_posix_message_queue.py
+++ b/tests/unit/configuration_subsystem/test_posix_message_queue.py
@@ -27,6 +27,7 @@ def test_posix_message_queue_ee(
     :param is_dir: The return value to set for ``pathlib.Path.is_dir``
     :param ee_support: The value to set for ``--ee``
     :param engine: The value to set for ``--ce``
+    :param platform: The system platform to mock
     :param generate_config: The configuration generator fixture
     """
     # pylint: disable=too-many-arguments
diff --git a/tests/unit/configuration_subsystem/test_previous_cli.py b/tests/unit/configuration_subsystem/test_previous_cli.py
index 2c459f728..b465d3de3 100644
--- a/tests/unit/configuration_subsystem/test_previous_cli.py
+++ b/tests/unit/configuration_subsystem/test_previous_cli.py
@@ -118,7 +118,6 @@ def test_apply_previous_cli_specified():
 
 def test_apply_previous_cli_mixed():
     """Ensure a mixed configuration passes"""
-
     params = "doc shell --ee False --eei test_image:latest --forks 15"
     application_configuration = deepcopy(NavigatorConfiguration)
     application_configuration.internals.initializing = True
diff --git a/tests/unit/configuration_subsystem/utils.py b/tests/unit/configuration_subsystem/utils.py
index e23951d21..d533f6145 100644
--- a/tests/unit/configuration_subsystem/utils.py
+++ b/tests/unit/configuration_subsystem/utils.py
@@ -1,6 +1,5 @@
 # cspell:ignore ecmd
-"""Utility functions used by adjacent tests
-"""
+"""Utility functions used by adjacent tests."""
 
 from ansible_navigator.configuration_subsystem.definitions import SettingsEntry
 
diff --git a/tests/unit/image_manager/__init__.py b/tests/unit/image_manager/__init__.py
index e69de29bb..4284c19b2 100644
--- a/tests/unit/image_manager/__init__.py
+++ b/tests/unit/image_manager/__init__.py
@@ -0,0 +1,1 @@
+"""Unit tests for the image_manager subsystem."""
diff --git a/tests/unit/test_cli.py b/tests/unit/test_cli.py
index 9ab6d1876..c4d8e75c3 100644
--- a/tests/unit/test_cli.py
+++ b/tests/unit/test_cli.py
@@ -1,5 +1,4 @@
-"""tests for CLI
-"""
+"""Tests using the CLi directly."""
 import shlex
 
 from copy import deepcopy
@@ -95,7 +94,6 @@
 @patch("shutil.which", return_value="/path/to/container_engine")
 def test_update_args_general(_mf1, monkeypatch, given, argname, expected):
     """test the parse and update function"""
-
     monkeypatch.setenv("ANSIBLE_NAVIGATOR_CONFIG", f"{FIXTURES_DIR}/unit/cli/ansible-navigator.yml")
     args = deepcopy(NavigatorConfiguration)
     args.internals.initializing = True
diff --git a/tests/unit/test_image_introspection.py b/tests/unit/test_image_introspection.py
index 97646ca31..9669ccfa8 100644
--- a/tests/unit/test_image_introspection.py
+++ b/tests/unit/test_image_introspection.py
@@ -1,6 +1,5 @@
 # cspell:ignore buildvm
-"""unit tests for image introspection
-"""
+"""Unit tests for image introspection."""
 import importlib
 
 import pytest
diff --git a/tests/unit/ui_framework/test_colorize.py b/tests/unit/ui_framework/test_colorize.py
index 376eb2a3d..d20c4322f 100644
--- a/tests/unit/ui_framework/test_colorize.py
+++ b/tests/unit/ui_framework/test_colorize.py
@@ -1,5 +1,4 @@
-"""tests for colorize
-"""
+"""Tests for colorize."""
 import os
 
 from typing import Dict
diff --git a/tests/unit/utils/test_functions.py b/tests/unit/utils/test_functions.py
index 8af2e51ad..5fc1b0894 100644
--- a/tests/unit/utils/test_functions.py
+++ b/tests/unit/utils/test_functions.py
@@ -18,7 +18,6 @@
 
 def test_find_many_settings_home(monkeypatch) -> None:
     """test more than one in home"""
-
     paths = [
         os.path.join(os.path.expanduser("~"), ".ansible-navigator" + ext) for ext in EXTENSIONS
     ]
@@ -34,7 +33,6 @@ def check_path_exists(arg):
 
 def test_find_many_settings_cwd(monkeypatch) -> None:
     """test more than one in CWD"""
-
     paths = [os.path.join(os.getcwd(), "ansible-navigator" + ext) for ext in EXTENSIONS]
 
     def check_path_exists(arg):
@@ -48,7 +46,6 @@ def check_path_exists(arg):
 
 def test_find_many_settings_precedence(monkeypatch) -> None:
     """test more than one in CWD"""
-
     expected = os.path.join(os.getcwd(), "ansible-navigator.yml")
     paths = [expected, os.path.join(os.path.expanduser("~"), ".ansible-navigator.json")]