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
  • Loading branch information
kschopmeyer committed Sep 23, 2024
1 parent ba31f8c commit 68aaaac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 32 deletions.
3 changes: 1 addition & 2 deletions pywbemtools/pywbemcli/_pywbem_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -465,8 +465,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
46 changes: 16 additions & 30 deletions tests/unit/pywbemcli/test_pywbemcli_operations.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,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 @@ -871,8 +858,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 Down

0 comments on commit 68aaaac

Please sign in to comment.