Skip to content

Commit

Permalink
Fixed issues raised by new Pylint version 2.9
Browse files Browse the repository at this point in the history
Details:

* Fixed new issue deprecated-class when importing from collections as a fallback
  on Python versions that do not yet have collections.abc.

* Fixed consider-using-with on an open/close sequence in test code by using with.

Signed-off-by: Andreas Maier <andreas.r.maier@gmx.de>
  • Loading branch information
andy-maier committed Jul 19, 2021
1 parent c866517 commit 9ee4a56
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 3 deletions.
2 changes: 2 additions & 0 deletions docs/changes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ Released: not yet
The function display_cim_objects(...) uses valuemapping_for_property() but
specifies the default namespace as the target. (See issue #995)

* Fixed issues raised by new Pylint version 2.9.

**Enhancements:**

**Cleanup:**
Expand Down
1 change: 1 addition & 0 deletions pywbemtools/pywbemcli/_common.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@
try:
from collections.abc import Sequence
except ImportError:
# pylint: disable=deprecated-class
from collections import Sequence

import six
Expand Down
3 changes: 2 additions & 1 deletion tests/unit/test_pywbem_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -549,7 +549,8 @@ def test_pysvr_connect_attrs(testcase, init_kwargs, exp_attrs):

# Create temp fake file.
# NOTE: We cannot use fixtures because we are using simplified_test_function
open(FAKE_PEM_PATH, 'a').close()
with open(FAKE_PEM_PATH, 'a'):
pass

# connect and test connection results. Try block insures finally is
# called.
Expand Down
3 changes: 1 addition & 2 deletions tests/unit/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,8 +159,7 @@ def execute_pywbemcli(args, env=None, stdin=None, verbose=None, condition=True):
rc = proc.returncode

# Restore environment of current process
for name in saved_env:
value = saved_env[name]
for name, value in saved_env.items():
if value is None:
del os.environ[name]
else:
Expand Down

0 comments on commit 9ee4a56

Please sign in to comment.