From e46288909862088ebf3f1dbb2b9e68c72caaf59c Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 6 Feb 2023 16:07:23 +0000 Subject: [PATCH 1/3] Bump inmanta-dev-dependencies[async,core,pytest,sphinx] Bumps [inmanta-dev-dependencies[async,core,pytest,sphinx]]() from 2.56.0 to 2.57.0. --- updated-dependencies: - dependency-name: inmanta-dev-dependencies[async,core,pytest,sphinx] dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] --- requirements.dev.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements.dev.txt b/requirements.dev.txt index d9ecaa23fa..317256b130 100644 --- a/requirements.dev.txt +++ b/requirements.dev.txt @@ -1,4 +1,4 @@ -inmanta-dev-dependencies[pytest,async,core,sphinx]==2.56.0 +inmanta-dev-dependencies[pytest,async,core,sphinx]==2.57.0 bumpversion==0.6.0 openapi_spec_validator==0.5.4 pip2pi==0.8.2 From 3d0f76f459e727f3636e21d1af8ed5d37b5355a2 Mon Sep 17 00:00:00 2001 From: Sander Van Balen Date: Tue, 7 Feb 2023 13:27:29 +0100 Subject: [PATCH 2/3] black --- src/inmanta/agent/handler.py | 1 - src/inmanta/ast/blocks.py | 1 - src/inmanta/ast/statements/assign.py | 1 - src/inmanta/ast/statements/call.py | 1 - src/inmanta/ast/statements/generator.py | 8 ++++---- src/inmanta/compiler/__init__.py | 1 - src/inmanta/config.py | 1 + src/inmanta/data/__init__.py | 2 +- src/inmanta/env.py | 1 - src/inmanta/execute/runtime.py | 6 +----- src/inmanta/execute/scheduler.py | 2 +- src/inmanta/model.py | 2 -- src/inmanta/moduletool.py | 4 +--- src/inmanta/protocol/common.py | 2 -- src/inmanta/server/agentmanager.py | 1 - src/inmanta/server/bootloader.py | 1 - src/inmanta/server/services/compilerservice.py | 1 - src/inmanta/server/services/resourceservice.py | 3 --- tests/agent_server/test_evolution.py | 1 - tests/compiler/test_execution.py | 1 - tests/compiler/test_is_defined.py | 1 - tests/compiler/test_resolution.py | 3 --- tests/data/modules/exp/plugins/__init__.py | 2 -- tests/db/test_db_schema.py | 2 -- tests/db/test_restore_tool.py | 1 - tests/moduletool/test_module_tool_basics.py | 1 - tests/server/test_compilerservice.py | 2 +- tests/server/test_incremental_deploy.py | 1 - tests/server/test_resource_action_logs.py | 2 -- tests/test_cache.py | 1 - tests/test_cli.py | 2 +- tests/test_config.py | 3 +-- tests/test_const.py | 1 - tests/test_data.py | 4 ++-- tests/test_extension_loading.py | 1 - tests/test_protocol.py | 3 --- tests/test_resource.py | 5 ----- tests/utils.py | 2 +- 38 files changed, 15 insertions(+), 63 deletions(-) diff --git a/src/inmanta/agent/handler.py b/src/inmanta/agent/handler.py index cfcbb71fc8..2513a8206c 100644 --- a/src/inmanta/agent/handler.py +++ b/src/inmanta/agent/handler.py @@ -133,7 +133,6 @@ def actual(f: Callable) -> T_FUNC: myargs = list(sig.parameters.keys())[1:] def wrapper(self, *args: object, **kwds: object) -> object: - kwds.update(dict(zip(myargs, args))) def bound(**kwds): diff --git a/src/inmanta/ast/blocks.py b/src/inmanta/ast/blocks.py index a511995991..666addacca 100644 --- a/src/inmanta/ast/blocks.py +++ b/src/inmanta/ast/blocks.py @@ -25,7 +25,6 @@ from inmanta.execute.runtime import QueueScheduler, Resolver if TYPE_CHECKING: - from inmanta.execute.runtime import ExecutionContext diff --git a/src/inmanta/ast/statements/assign.py b/src/inmanta/ast/statements/assign.py index 791e4363b1..a1d5250d36 100644 --- a/src/inmanta/ast/statements/assign.py +++ b/src/inmanta/ast/statements/assign.py @@ -302,7 +302,6 @@ def receive_result(self, value: T, location: Location) -> None: class SetAttributeHelper(ExecutionUnit): - __slots__ = ("stmt", "instance", "attribute_name") def __init__( diff --git a/src/inmanta/ast/statements/call.py b/src/inmanta/ast/statements/call.py index 2dba382f82..e0347d6f4d 100644 --- a/src/inmanta/ast/statements/call.py +++ b/src/inmanta/ast/statements/call.py @@ -262,7 +262,6 @@ def call_in_context( class FunctionUnit(Waiter): - __slots__ = ("result", "base_requires", "function", "resolver") def __init__(self, queue_scheduler, resolver, result: ResultVariable, requires, function: FunctionCall) -> None: diff --git a/src/inmanta/ast/statements/generator.py b/src/inmanta/ast/statements/generator.py index 31971a4975..f89e465137 100644 --- a/src/inmanta/ast/statements/generator.py +++ b/src/inmanta/ast/statements/generator.py @@ -520,7 +520,7 @@ def pretty_print(self) -> str: ) def _normalize_rhs(self, index_attributes: abc.Set[str]) -> None: - for (k, v) in self.__attributes.items(): + for k, v in self.__attributes.items(): # don't notify the rhs for index attributes because it won't be able to resolve the reference # (index attributes need to be resolved before the instance can be constructed) v.normalize(lhs_attribute=AttributeAssignmentLHS(self._self_ref, k) if k not in index_attributes else None) @@ -557,7 +557,7 @@ def normalize(self, *, lhs_attribute: Optional[AttributeAssignmentLHS] = None) - self._normalize_rhs(inindex) - for (k, v) in all_attributes.items(): + for k, v in all_attributes.items(): attribute = self.type.get_attribute(k) if attribute is None: raise TypingException(self, "no attribute %s on type %s" % (k, self.type.get_full_name())) @@ -605,7 +605,7 @@ def requires_emit(self, resolver: Resolver, queue: QueueScheduler) -> Dict[objec if graph is not None: node: dataflow.InstanceNodeReference = self._register_dataflow_node(graph) # TODO: also add wrapped_kwargs - for (k, v) in chain(self._direct_attributes.items(), self._indirect_attributes.items()): + for k, v in chain(self._direct_attributes.items(), self._indirect_attributes.items()): node.assign_attribute(k, v.get_dataflow_node(graph), self, graph) return requires @@ -623,7 +623,7 @@ def _collect_required_dynamic_arguments( # kwargs kwarg_attrs: dict[str, object] = {} for kwargs in self.wrapped_kwargs: - for (k, v) in kwargs.execute(requires, resolver, queue): + for k, v in kwargs.execute(requires, resolver, queue): if k in self.attributes or k in kwarg_attrs: raise RuntimeException( self, "The attribute %s is set twice in the constructor call of %s." % (k, self.class_type) diff --git a/src/inmanta/compiler/__init__.py b/src/inmanta/compiler/__init__.py index 50af936241..7770cda185 100644 --- a/src/inmanta/compiler/__init__.py +++ b/src/inmanta/compiler/__init__.py @@ -197,7 +197,6 @@ def compile(self) -> Tuple[List["Statement"], List["BasicBlock"]]: # load plugins for name, cls in PluginMeta.get_functions().items(): - mod_ns = cls.__module__.split(".") if mod_ns[0] != const.PLUGINS_PACKAGE: raise Exception( diff --git a/src/inmanta/config.py b/src/inmanta/config.py index 19b5946b6a..9e0efe9332 100644 --- a/src/inmanta/config.py +++ b/src/inmanta/config.py @@ -386,6 +386,7 @@ def get_default_nodename() -> str: nodename = Option("config", "node-name", get_default_nodename, "Force the hostname of this machine to a specific value", is_str) feature_file_config = Option("config", "feature-file", None, "The loacation of the inmanta feature file.", is_str_opt) + ############################### # Transport Config ############################### diff --git a/src/inmanta/data/__init__.py b/src/inmanta/data/__init__.py index f2805e8f41..8f1142f5d7 100644 --- a/src/inmanta/data/__init__.py +++ b/src/inmanta/data/__init__.py @@ -3333,7 +3333,7 @@ async def update_primary( primary. If the session id is None, the Agent doesn't have a primary anymore. :param now: Timestamp of this failover """ - for (endpoint, sid) in endpoints_with_new_primary: + for endpoint, sid in endpoints_with_new_primary: # Lock mode is required because we will update in this transaction # Deadlocks with cleanup otherwise agent = await cls.get(env, endpoint, connection=connection, lock=RowLockMode.FOR_UPDATE) diff --git a/src/inmanta/env.py b/src/inmanta/env.py index 33423fee40..56244b4095 100644 --- a/src/inmanta/env.py +++ b/src/inmanta/env.py @@ -109,7 +109,6 @@ class ConflictingRequirements(CompilerException): """ def __init__(self, message: str, conflicts: Optional[Set[VersionConflict]] = None): - CompilerException.__init__(self, msg=message) self.conflicts = conflicts diff --git a/src/inmanta/execute/runtime.py b/src/inmanta/execute/runtime.py index ff14068224..334d6e69e1 100644 --- a/src/inmanta/execute/runtime.py +++ b/src/inmanta/execute/runtime.py @@ -1015,7 +1015,6 @@ def execute(self) -> None: class Resolver(object): - __slots__ = ("namespace", "dataflow_graph") def __init__(self, namespace: Namespace, enable_dataflow_graph: bool = False) -> None: @@ -1080,7 +1079,6 @@ def get_root_resolver(self) -> "Resolver": class NamespaceResolver(Resolver): - __slots__ = ("parent", "root") def __init__(self, parent: Resolver, lecial_root: Namespace) -> None: @@ -1103,7 +1101,6 @@ def get_root_resolver(self) -> "Resolver": class ExecutionContext(Resolver): - __slots__ = ("block", "slots", "resolver") def __init__(self, block: "BasicBlock", resolver: Resolver): @@ -1275,9 +1272,8 @@ def dump(self) -> None: print("------------ ") print(str(self)) print("------------ ") - for (n, v) in self.slots.items(): + for n, v in self.slots.items(): if v.can_get(): - value = v.value print("%s\t\t%s" % (n, value)) else: diff --git a/src/inmanta/execute/scheduler.py b/src/inmanta/execute/scheduler.py index 2d884024fc..aaae76c16a 100644 --- a/src/inmanta/execute/scheduler.py +++ b/src/inmanta/execute/scheduler.py @@ -212,7 +212,7 @@ def define_types(self, compiler: "Compiler", statements: Sequence["Statement"], k for k in [t.register_types() for t in definitions if isinstance(t, TypeDefinitionStatement)] if k is not None ] - for (name, type_symbol) in newtypes: + for name, type_symbol in newtypes: types_and_impl[name] = type_symbol # now that we have objects for all types, populate them diff --git a/src/inmanta/model.py b/src/inmanta/model.py index 8b1dc66586..66f5a18d1b 100644 --- a/src/inmanta/model.py +++ b/src/inmanta/model.py @@ -102,7 +102,6 @@ def to_dict(self) -> JsonType: @staticmethod def from_dict(ctx: JsonType) -> None: - return Attribute( mytype=ctx["type"], nullable=ctx["nullable"], @@ -163,7 +162,6 @@ class ReferenceValue(Value): """ def __init__(self, reference): - self.reference = reference def to_dict(self) -> JsonType: diff --git a/src/inmanta/moduletool.py b/src/inmanta/moduletool.py index 8d0619cf0d..dce8e39f64 100644 --- a/src/inmanta/moduletool.py +++ b/src/inmanta/moduletool.py @@ -912,7 +912,6 @@ def show_bool(b: bool) -> str: names: Sequence[str] = sorted(project.modules.keys()) specs: Dict[str, List[InmantaModuleRequirement]] = project.collect_imported_requirements() for name in names: - mod: Module = Project.get().modules[name] version = str(mod.version) if name not in specs: @@ -1523,7 +1522,6 @@ def destroy(self) -> None: class V2ModuleBuilder: - DISABLE_ISOLATED_ENV_BUILDER_CACHE: bool = False def __init__(self, module_path: str) -> None: @@ -1668,7 +1666,7 @@ def should_ignore(name: str) -> bool: if not os.path.isdir(directory): raise Exception(f"{directory} is not a directory") result: Set[str] = set() - for (dirpath, dirnames, filenames) in os.walk(directory): + for dirpath, dirnames, filenames in os.walk(directory): if should_ignore(os.path.basename(dirpath)): # ignore whole subdirectory continue diff --git a/src/inmanta/protocol/common.py b/src/inmanta/protocol/common.py index e1fc92173a..ab480c014a 100644 --- a/src/inmanta/protocol/common.py +++ b/src/inmanta/protocol/common.py @@ -337,7 +337,6 @@ class InvalidMethodDefinition(Exception): class MethodArgumentsBaseModel(pydantic.BaseModel): - _normalize_timestamps: ClassVar[classmethod] = pydantic.validator("*", allow_reuse=True)( validator_timezone_aware_timestamps ) @@ -680,7 +679,6 @@ def arg_options(self) -> Dict[str, ArgOption]: @property def timeout(self) -> Optional[int]: - return self._timeout @property diff --git a/src/inmanta/server/agentmanager.py b/src/inmanta/server/agentmanager.py index 297d11d527..be292d94f0 100644 --- a/src/inmanta/server/agentmanager.py +++ b/src/inmanta/server/agentmanager.py @@ -841,7 +841,6 @@ async def request_parameter(self, env_id: uuid.UUID, resource_id: ResourceIdStr) resource_id not in self._fact_resource_block_set or (self._fact_resource_block_set[resource_id] + self._fact_resource_block) < now ): - agents = await data.ConfigurationModel.get_agents(env.id, version) await self._autostarted_agent_manager._ensure_agents(env, agents) diff --git a/src/inmanta/server/bootloader.py b/src/inmanta/server/bootloader.py index 65509849d7..65101cd581 100644 --- a/src/inmanta/server/bootloader.py +++ b/src/inmanta/server/bootloader.py @@ -42,7 +42,6 @@ def iter_namespace(ns_pkg: ModuleType) -> Generator[ModuleInfo, None, None]: class PluginLoadFailed(Exception): - pass diff --git a/src/inmanta/server/services/compilerservice.py b/src/inmanta/server/services/compilerservice.py index 99fe832d55..4ce3716c13 100644 --- a/src/inmanta/server/services/compilerservice.py +++ b/src/inmanta/server/services/compilerservice.py @@ -870,7 +870,6 @@ async def get_compile_reports( filter: Optional[Dict[str, List[str]]] = None, sort: str = "requested.desc", ) -> ReturnValue[Sequence[model.CompileReport]]: - try: handler = CompileReportView(env, limit, filter, sort, first_id, last_id, start, end) return await handler.execute() diff --git a/src/inmanta/server/services/resourceservice.py b/src/inmanta/server/services/resourceservice.py index 8100c6e019..b3cc6cd529 100644 --- a/src/inmanta/server/services/resourceservice.py +++ b/src/inmanta/server/services/resourceservice.py @@ -901,7 +901,6 @@ async def resource_list( sort: str = "resource_type.desc", deploy_summary: bool = False, ) -> ReturnValueWithMeta[Sequence[LatestReleasedResource]]: - try: handler = ResourceView(env, limit, first_id, last_id, start, end, filter, sort, deploy_summary) @@ -917,7 +916,6 @@ async def resource_list( @handle(methods_v2.resource_details, env="tid") async def resource_details(self, env: data.Environment, rid: ResourceIdStr) -> ReleasedResourceDetails: - details = await data.Resource.get_resource_details(env.id, rid) if not details: raise NotFound("The resource with the given id does not exist, or was not released yet in the given environment.") @@ -982,7 +980,6 @@ async def get_resources_in_version( filter: Optional[Dict[str, List[str]]] = None, sort: str = "resource_type.desc", ) -> ReturnValueWithMeta[Sequence[VersionedResource]]: - try: handler = ResourcesInVersionView(env, version, limit, filter, sort, first_id, last_id, start, end) return await handler.execute() diff --git a/tests/agent_server/test_evolution.py b/tests/agent_server/test_evolution.py index 25d584978b..c0b968d5a3 100644 --- a/tests/agent_server/test_evolution.py +++ b/tests/agent_server/test_evolution.py @@ -163,7 +163,6 @@ def update_resource(self, ctx: HandlerContext, changes: dict, resource: Purgeabl async def test_resource_evolution(server, client, environment, no_agent_backoff, snippetcompiler, monkeypatch, async_finalizer): - provider = resource_container_a() agent = await get_agent(server, environment, "agent1") diff --git a/tests/compiler/test_execution.py b/tests/compiler/test_execution.py index 6bc3d2e9c6..195147f72e 100644 --- a/tests/compiler/test_execution.py +++ b/tests/compiler/test_execution.py @@ -345,7 +345,6 @@ def test_lazy_attibutes3(snippetcompiler): def test_veryhardsequencing(snippetcompiler): - snippetcompiler.setup_for_snippet( """ implementation none for std::Entity: diff --git a/tests/compiler/test_is_defined.py b/tests/compiler/test_is_defined.py index daeb1dd8b2..5ebb275d3f 100644 --- a/tests/compiler/test_is_defined.py +++ b/tests/compiler/test_is_defined.py @@ -74,7 +74,6 @@ def gen(var): if mode % 2 == 0: var = f"self.{var}" if mode == 1 or mode == 2: - return f""" implementation printt for A: std::print("true") diff --git a/tests/compiler/test_resolution.py b/tests/compiler/test_resolution.py index 8805ed0b85..6644a47c7f 100644 --- a/tests/compiler/test_resolution.py +++ b/tests/compiler/test_resolution.py @@ -67,7 +67,6 @@ def test_issue_110_resolution(snippetcompiler): def test_issue_134_colliding_umplementations(snippetcompiler): - snippetcompiler.setup_for_snippet( """ implementation test for std::Entity: @@ -122,7 +121,6 @@ def test_400_typeloops_2(snippetcompiler): def test_438_parent_scopes_accessible(snippetcompiler): - snippetcompiler.setup_for_snippet( """ entity Host: @@ -160,7 +158,6 @@ def test_438_parent_scopes_accessible(snippetcompiler): def test_438_parent_scopes_accessible_2(snippetcompiler): - snippetcompiler.setup_for_snippet( """ entity Host: diff --git a/tests/data/modules/exp/plugins/__init__.py b/tests/data/modules/exp/plugins/__init__.py index 2621d5a0d8..e04cec5f94 100644 --- a/tests/data/modules/exp/plugins/__init__.py +++ b/tests/data/modules/exp/plugins/__init__.py @@ -44,7 +44,6 @@ class Test2(resources.PurgeableResource): @resources.resource("exp::Test3", id_attribute="name", agent="name") class Test3(resources.PurgeableResource): - fields = ( "name", "real_name", @@ -57,7 +56,6 @@ def get_real_name(_, entity): @resources.resource("exp::RequiresTest", agent="agent", id_attribute="name") class RequiresTest(resources.PurgeableResource): - fields = ("name", "agent", "do_break") diff --git a/tests/db/test_db_schema.py b/tests/db/test_db_schema.py index d70222d6ef..d7052e3732 100644 --- a/tests/db/test_db_schema.py +++ b/tests/db/test_db_schema.py @@ -249,7 +249,6 @@ async def test_dbschema_ensure_self_update( async def test_dbschema_update_db_schema(postgresql_client, get_columns_in_db_table, hard_clean_db, hard_clean_db_post): - db_schema = schema.DBSchema("test_dbschema_update_db_schema", inmanta.db.versions, postgresql_client) await db_schema.ensure_self_update() @@ -382,7 +381,6 @@ def disabled(module: types.ModuleType) -> bool: async def test_multi_upgrade_lockout(postgresql_pool, get_columns_in_db_table, hard_clean_db): async with postgresql_pool.acquire() as postgresql_client: async with postgresql_pool.acquire() as postgresql_client2: - # schedule 3 updates, hang on second, unblock one, verify, unblock other, verify corev: Set[int] = await get_core_versions(postgresql_client) diff --git a/tests/db/test_restore_tool.py b/tests/db/test_restore_tool.py index 81783ed730..85c47b5f1a 100644 --- a/tests/db/test_restore_tool.py +++ b/tests/db/test_restore_tool.py @@ -21,7 +21,6 @@ async def test_pg_restore(hard_clean_db, hard_clean_db_post, postgresql_client: Connection): - inp = r""" CREATE TABLE public.agent ( environment uuid NOT NULL, diff --git a/tests/moduletool/test_module_tool_basics.py b/tests/moduletool/test_module_tool_basics.py index f8abb460f7..186ec2f23f 100644 --- a/tests/moduletool/test_module_tool_basics.py +++ b/tests/moduletool/test_module_tool_basics.py @@ -154,7 +154,6 @@ def test_rewrite(tmpdir, module_type: Type[module.Module]): def metadata_contents(version: str, version_tag: str = "") -> str: if v1: - return f""" name: mod license: ASL diff --git a/tests/server/test_compilerservice.py b/tests/server/test_compilerservice.py index a9e3f83c86..62f7c63f3a 100644 --- a/tests/server/test_compilerservice.py +++ b/tests/server/test_compilerservice.py @@ -1184,7 +1184,7 @@ async def test_compileservice_auto_recompile_wait( LogSequence(caplog, allow_errors=False).contains( "inmanta.server.services.compilerservice", logging.DEBUG, "Running recompile without waiting" - ).contains("inmanta.server.services.compilerservice", expected_log_level, expected_log_message,).contains( + ).contains("inmanta.server.services.compilerservice", expected_log_level, expected_log_message).contains( "inmanta.server.services.compilerservice", logging.DEBUG, "Running recompile without waiting" ) diff --git a/tests/server/test_incremental_deploy.py b/tests/server/test_incremental_deploy.py index cb0b4e97f3..79b153e313 100644 --- a/tests/server/test_incremental_deploy.py +++ b/tests/server/test_incremental_deploy.py @@ -131,7 +131,6 @@ def add_resource( return rid async def setup_agent(self, server, environment): - agentmanager = server.get_slice(SLICE_AGENT_MANAGER) endpoints = list(self.results.keys()) diff --git a/tests/server/test_resource_action_logs.py b/tests/server/test_resource_action_logs.py index 308040bb08..e7fc4927d4 100644 --- a/tests/server/test_resource_action_logs.py +++ b/tests/server/test_resource_action_logs.py @@ -300,7 +300,6 @@ async def test_filter_validation(server, client, filter, expected_status, env_wi async def test_log_without_kwargs(server, client, environment: str): - await data.ConfigurationModel( environment=uuid.UUID(environment), version=1, @@ -357,7 +356,6 @@ async def test_log_without_kwargs(server, client, environment: str): async def test_log_nested_kwargs(server, client, environment: str): - await data.ConfigurationModel( environment=uuid.UUID(environment), version=1, diff --git a/tests/test_cache.py b/tests/test_cache.py index 14dee1e903..8e5a45ea90 100644 --- a/tests/test_cache.py +++ b/tests/test_cache.py @@ -265,7 +265,6 @@ def test_get_or_else(my_resource): called = [] def creator(param, resource, version): - called.append("x") return param diff --git a/tests/test_cli.py b/tests/test_cli.py index 93b0979200..5ff062a6aa 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -309,7 +309,7 @@ async def assert_agent_paused(env_id: uuid.UUID, expected_records: Dict[str, boo assert result.exit_code == 0 output = result.stdout.replace(" ", "") assert "Agent|Environment|Paused" in output - for (agent_name, paused) in expected_records.items(): + for agent_name, paused in expected_records.items(): assert f"{agent_name}|{env_id}|{paused}" in output await assert_agent_paused(env_id=env1.id, expected_records=dict(agent1=False, agent2=False)) diff --git a/tests/test_config.py b/tests/test_config.py index f9868820ba..ca1e920faf 100644 --- a/tests/test_config.py +++ b/tests/test_config.py @@ -32,11 +32,10 @@ def test_environment_deprecated_options(caplog): - for (deprecated_option, new_option) in [ + for deprecated_option, new_option in [ (cfg.agent_interval, cfg.agent_deploy_interval), (cfg.agent_splay, cfg.agent_deploy_splay_time), ]: - Config.set(deprecated_option.section, deprecated_option.name, "22") caplog.clear() assert new_option.get() == 22 diff --git a/tests/test_const.py b/tests/test_const.py index 84d8c7cb44..bb284e8e0e 100644 --- a/tests/test_const.py +++ b/tests/test_const.py @@ -28,7 +28,6 @@ def test_action_set_consistency(): - undep = set(UNDEPLOYABLE_STATES) transient = set(TRANSIENT_STATES) not_done = set(NOT_DONE_STATES) diff --git a/tests/test_data.py b/tests/test_data.py index ab1fe09901..38ac273d8c 100644 --- a/tests/test_data.py +++ b/tests/test_data.py @@ -222,7 +222,7 @@ def func(x): assert func(await data.AgentInstance.get_by_id(agent_instances[0].id)) assert func(await data.AgentInstance.get_by_id(agent_instances[1].id)) assert func(await data.Agent.get_one(environment=agent.environment, name=agent.name)) - for (environment, resource_version_id) in resource_ids: + for environment, resource_version_id in resource_ids: id = Id.parse_id(resource_version_id) assert func(await data.Resource.get_one(environment=environment, resource_id=id.resource_str(), model=id.version)) assert func(await data.Code.get_one(environment=code.environment, resource=code.resource, version=code.version)) @@ -391,7 +391,7 @@ async def test_environment_deprecated_setting(init_dataclasses_and_load_schema, env = data.Environment(name="dev", project=project.id, repo_url="", repo_branch="") await env.insert() - for (deprecated_option, new_option) in [ + for deprecated_option, new_option in [ (data.AUTOSTART_AGENT_INTERVAL, data.AUTOSTART_AGENT_DEPLOY_INTERVAL), (data.AUTOSTART_SPLAY, data.AUTOSTART_AGENT_DEPLOY_SPLAY_TIME), ]: diff --git a/tests/test_extension_loading.py b/tests/test_extension_loading.py index 6e1407a57e..39373369e0 100644 --- a/tests/test_extension_loading.py +++ b/tests/test_extension_loading.py @@ -60,7 +60,6 @@ def splice_extension_in(name: str) -> Generator[Any, Any, None]: def test_discover_and_load(): with splice_extension_in("test_module_path"): - config.server_enabled_extensions.set("testplugin") ibl = InmantaBootloader() diff --git a/tests/test_protocol.py b/tests/test_protocol.py index b409c47d18..2a8a2547ce 100644 --- a/tests/test_protocol.py +++ b/tests/test_protocol.py @@ -151,7 +151,6 @@ def do_test(): async def test_client_files_stat(client): - file_names = [] i = 0 while i < 10: @@ -456,7 +455,6 @@ async def test_methodi(self, project: Project) -> ReturnValue[Project]: @protocol.handle(test_method2) async def test_method2i(self, project: List[Project]) -> ReturnValue[List[Project]]: - return ReturnValue(response=project) rs = Server() @@ -1336,7 +1334,6 @@ def test_method() -> ReturnValue[str]: # NOQA class TestServer(ServerSlice): @protocol.handle(test_method) async def test_methodY(self) -> ReturnValue[str]: # NOQA - return ReturnValue(response=html_content, content_type=HTML_CONTENT_WITH_UTF8_CHARSET) rs = Server() diff --git a/tests/test_resource.py b/tests/test_resource.py index a274ec69dc..88a0902034 100644 --- a/tests/test_resource.py +++ b/tests/test_resource.py @@ -59,7 +59,6 @@ class Test(Base): def test_resource_base(snippetcompiler): - import inmanta.resources @resource("__config__::XResource", agent="agent", id_attribute="key") @@ -98,7 +97,6 @@ class MyResource(inmanta.resources.Resource): def test_resource_base_with_method_key(snippetcompiler): - import inmanta.resources @resource("__config__::XResource", agent="agent", id_attribute="key") @@ -135,7 +133,6 @@ def get_serialize(_exporter, resource): def test_resource_with_keyword(snippetcompiler): - import inmanta.resources @resource("__config__::YResource", agent="agent", id_attribute="key") @@ -173,7 +170,6 @@ def get_model(_exporter, resource): def test_resource_with_private_method(snippetcompiler): - import inmanta.resources @resource("__config__::YResource", agent="agent", id_attribute="key") @@ -233,7 +229,6 @@ class MyResource(inmanta.resources.Resource): def test_resource_invalid_agent_name_annotation(): - import inmanta.resources with pytest.raises(ResourceException): diff --git a/tests/utils.py b/tests/utils.py index 3d37234d59..f0c0cfb9b4 100644 --- a/tests/utils.py +++ b/tests/utils.py @@ -102,7 +102,7 @@ def keyfunc(val): minimal = sorted(minimal, key=keyfunc) actual = sorted(actual, key=keyfunc) - for (m, a) in zip(minimal, actual): + for m, a in zip(minimal, actual): assert_equal_ish(m, a, sortby) elif minimal is UNKWN: return From c022b011dcbc0b0c6ecb39351500972b2886ae1b Mon Sep 17 00:00:00 2001 From: inmantaci Date: Tue, 7 Feb 2023 13:49:17 +0100 Subject: [PATCH 3/3] Added change entry --- changelogs/unreleased/5502-dependabot.yml | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 changelogs/unreleased/5502-dependabot.yml diff --git a/changelogs/unreleased/5502-dependabot.yml b/changelogs/unreleased/5502-dependabot.yml new file mode 100644 index 0000000000..5f7024bed2 --- /dev/null +++ b/changelogs/unreleased/5502-dependabot.yml @@ -0,0 +1,7 @@ +change-type: patch +description: Bump inmanta-dev-dependencies[async,core,pytest,sphinx] from 2.56.0 to + 2.57.0 +destination-branches: +- master +- iso6 +sections: {}