Skip to content

Commit

Permalink
Add unidiomatic-typecheck check (#3893)
Browse files Browse the repository at this point in the history
  • Loading branch information
Ruchip16 authored Apr 24, 2023
1 parent 913f474 commit 2bf5396
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 4 deletions.
2 changes: 0 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,6 @@ disable = [
"too-many-ancestors",
"too-many-arguments",
"too-many-public-methods",
"unidiomatic-typecheck",
"unnecessary-comprehension",
# Next rule was added because we cannot adjust the open calls during minor
# releases since there is no guarantee that this will not break existing
# scenarios (right now, we have no idea what encoding files that molecule
Expand Down
4 changes: 2 additions & 2 deletions src/molecule/test/unit/model/v2/test_driver_section.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ def test_driver_has_errors(_config):
base_error_msg = "is not one of ['azure', 'ec2', 'delegated', 'docker', 'containers', 'openstack', 'podman', 'vagrant', 'digitalocean', 'gce', 'libvirt', 'lxd', 'molecule-*', 'molecule_*', 'custom-*', 'custom_*']"

driver_name = str(_config["driver"]["name"])
if type(_config["driver"]["name"]) is str:
if isinstance(_config["driver"]["name"], str):
# add single quotes for string
driver_name = f"'{driver_name}'"
driver_name = f"'{_config['driver']['name']}'"

error_msg = [" ".join((driver_name, base_error_msg))]
assert error_msg == schema_v3.validate(_config)
Expand Down

0 comments on commit 2bf5396

Please sign in to comment.