Skip to content

Commit

Permalink
Remove additional python 2.7 leftover.
Browse files Browse the repository at this point in the history
Removes another couple of things involving python 2.7

1. Test that was specialized for python 2.7 on windows, Issue 1590
2. Reference to python 2.7 in pywbem_server
3. Remove tests/unit/pywbemcli/test_python_tell.py - This test was
   created to confirm that there were no issues between the tell()
   function on windows with python 2.7 and to verify that
   test_build_mockenv() works. With the removal of python 2.7 as
   a platform, this test is no longer necessary.
4. version doc that used python 2.7.11 as example in tools.

Note that one test in test_pywbemcli_operations.py from the group
that was disabled because of a windows issue is still marked
disabled because that test fails.  See issue #1440.
  • Loading branch information
kschopmeyer committed Oct 29, 2024
1 parent ee84735 commit 8d15d22
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 122 deletions.
4 changes: 2 additions & 2 deletions docs/pywbemcli/cmdshelp.rst
Original file line number Diff line number Diff line change
Expand Up @@ -659,7 +659,7 @@ Help text for ``pywbemcli connection`` (see :ref:`connection command group`):
delete Delete a WBEM connection definition.
select Select a WBEM connection definition as current or default.
test Test the current connection with a predefined WBEM request.
save Save the current connection parameters to a named WBEM connection.
save Save the current connection parameters to a named connection.
list List the WBEM connection definitions.
set-default Set a connection as the default connection.

Expand Down Expand Up @@ -762,7 +762,7 @@ Help text for ``pywbemcli connection save`` (see :ref:`connection save command`)

Usage: pywbemcli [GENERAL-OPTIONS] connection save NAME [COMMAND-OPTIONS]

Save the current connection parameters to a named WBEM connection.
Save the current connection parameters to a named connection.

Save the current connection to the connections file as a connection definition named NAME. The NAME argument is
required. If a connection definition with that name already exists, it is overwritten without warning.
Expand Down
3 changes: 1 addition & 2 deletions pywbemtools/pywbemcli/_pywbem_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -467,8 +467,7 @@ def copy(self):
Used to copy PywbemServer so that a deep copy is not applied to
conn which would cause the repository to be copied in the
case of FakedWBEMConnection, and possible exceptions
with pywbem 2.7
case of FakedWBEMConnection.
"""
cpy = PywbemServer(
server=self.server,
Expand Down
87 changes: 0 additions & 87 deletions tests/unit/pywbemcli/test_python_tell.py

This file was deleted.

47 changes: 17 additions & 30 deletions tests/unit/pywbemcli/test_pywbemcli_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,11 +52,6 @@

URLLIB3_VERSION = packaging.version.parse(urllib3.__version__)

# Click (as of 7.1.2) raises UnsupportedOperation in click.echo() when
# the pytest capsys fixture is used. That happens only on Windows.
# See Click issue https://github.com/pallets/click/issues/1590. This
# run condition skips the testcases on Windows.
CLICK_ISSUE_1590 = sys.platform == 'win32'

SCRIPT_DIR = os.path.dirname(__file__)
USER_CONNECTIONS_FILE = os.path.join(SCRIPT_DIR, '.user_connections_file.yaml')
Expand Down Expand Up @@ -503,7 +498,7 @@ def remove_mockcache(connection_name):
exp_stdout_lines_all=False,
exp_stderr_lines=[],
),
None, DeprecatedSetupWarning, not CLICK_ISSUE_1590
None, DeprecatedSetupWarning, OK
),
(
"Mock env with MOF file and old-style mock script, "
Expand All @@ -528,7 +523,7 @@ def remove_mockcache(connection_name):
exp_stdout_lines_all=False,
exp_stderr_lines=[],
),
None, DeprecatedSetupWarning, not CLICK_ISSUE_1590
None, DeprecatedSetupWarning, OK
),
(
"Mock env with MOF file and old-style mock script, "
Expand All @@ -553,8 +548,7 @@ def remove_mockcache(connection_name):
# preparation for executing the code to be tested. If the mock env is
# not cached, there is no pkl file that can be removed, so this
# testcase is skipped when the mock env cannot be cached.
None, DeprecatedSetupWarning,
NEWSTYLE_SUPPORTED and not CLICK_ISSUE_1590
None, DeprecatedSetupWarning, OK
),
(
"Mock env with MOF file and old-style mock script, "
Expand All @@ -580,7 +574,7 @@ def remove_mockcache(connection_name):
# not cached, there is no md5 file that can be removed, so this
# testcase is skipped when the mock env cannot be cached.
None, DeprecatedSetupWarning,
NEWSTYLE_SUPPORTED and not CLICK_ISSUE_1590
NEWSTYLE_SUPPORTED
),
(
"Mock env with MOF file and old-style mock script, "
Expand All @@ -606,7 +600,7 @@ def remove_mockcache(connection_name):
# not cached, there is no dep file that can be removed, so this
# testcase is skipped when the mock env cannot be cached.
None, DeprecatedSetupWarning,
NEWSTYLE_SUPPORTED and not CLICK_ISSUE_1590
NEWSTYLE_SUPPORTED
),
(
"Mock env with MOF file and old-style mock script, "
Expand All @@ -632,7 +626,7 @@ def remove_mockcache(connection_name):
exp_stdout_lines_all=False,
exp_stderr_lines=[],
),
None, DeprecatedSetupWarning, not CLICK_ISSUE_1590
None, DeprecatedSetupWarning, OK
),
(
"Mock env with MOF file and old-style mock script, "
Expand All @@ -658,7 +652,7 @@ def remove_mockcache(connection_name):
exp_stdout_lines_all=False,
exp_stderr_lines=[],
),
None, DeprecatedSetupWarning, not CLICK_ISSUE_1590
None, DeprecatedSetupWarning, OK
),
(
"Mock env with MOF file and new-style mock script, "
Expand All @@ -680,8 +674,7 @@ def remove_mockcache(connection_name):
exp_stderr_lines=[],
),
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, OK

),
(
Expand All @@ -703,8 +696,7 @@ def remove_mockcache(connection_name):
exp_stderr_lines=[],
),
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, OK
),
(
"Mock env with MOF file and new-style mock script, "
Expand All @@ -726,8 +718,7 @@ def remove_mockcache(connection_name):
exp_stderr_lines=[],
),
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, OK
),
(
"Mock env with MOF file and new-style mock script, "
Expand All @@ -749,8 +740,7 @@ def remove_mockcache(connection_name):
exp_stderr_lines=[],
),
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, OK
),
(
"Mock env with MOF file and new-style mock script, "
Expand All @@ -773,8 +763,7 @@ def remove_mockcache(connection_name):
exp_stderr_lines=[],
),
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, OK
),
(
"Mock env with MOF file and new-style mock script, "
Expand All @@ -797,8 +786,7 @@ def remove_mockcache(connection_name):
exp_stderr_lines=[],
),
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, OK
),

# Testcases with non-cacheable user-specified connections file
Expand All @@ -825,7 +813,7 @@ def remove_mockcache(connection_name):
exp_stdout_lines_all=False,
exp_stderr_lines=[],
),
None, DeprecatedSetupWarning, not CLICK_ISSUE_1590
None, DeprecatedSetupWarning, OK
),

# Testcases with standalone mock script that has dependents
Expand All @@ -848,8 +836,7 @@ def remove_mockcache(connection_name):
exp_stderr_lines=[],
),
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, OK
),
(
"Mock env with standalone mock script with deps; change dependent file",
Expand All @@ -870,9 +857,9 @@ def remove_mockcache(connection_name):
exp_stdout_lines_all=False,
exp_stderr_lines=[],
),
# See issue #1440 failure of this test with windows
None if NEWSTYLE_SUPPORTED else SetupNotSupportedError,
DeprecationWarning if RETRY_DEPRECATION else None,
not CLICK_ISSUE_1590
DeprecationWarning if RETRY_DEPRECATION else None, not "win32"
),

]
Expand Down
2 changes: 1 addition & 1 deletion tools/python_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
print("Error: Incorrect number of command line arguments")
print(f"Usage: {sys.argv[0]} version_level")
print("Where version_level is the number of components in the "
"version string from 1 to 3, e.g. 3 means Python 2.7.11")
"version string from 1 to 3, e.g. 3 means Python 3.12.1")

sys.exit(2)

Expand Down

0 comments on commit 8d15d22

Please sign in to comment.