Skip to content
This repository has been archived by the owner on Apr 7, 2022. It is now read-only.

[RFR] Apply pyupgrade #10027

Merged
merged 2 commits into from
Mar 31, 2020
Merged

[RFR] Apply pyupgrade #10027

merged 2 commits into from
Mar 31, 2020

Conversation

mshriver
Copy link
Member

I did a few things here:

  1. Move the order of the plugins in pre-commit
  2. Use the upstream repo for flake8, pre-commit hook is deprecated
  3. Enable pyupgrade on the whole repo
  4. Run pre-commit, applying pyupgrade changes

@dajoRH
Copy link
Contributor

dajoRH commented Mar 31, 2020

I detected some fixture changes in commit e5755e8

Show fixtures

The global fixture blockers was changed, but I didn't find where it's used.
The global fixture bug was changed, but I didn't find where it's used.
The global fixture disable_forgery_protection was changed, but I didn't find where it's used.
The global fixture has_persistent_volume is used in the following files:

  • cfme/tests/containers/test_relationships.py
    • test_relationships_tables

The global fixture with_nuage_sandbox_modscope is used in the following files:

  • cfme/tests/networks/nuage/test_inventory.py
    • test_tenant_details
    • test_subnet_details
    • test_l2_subnet_details
    • test_network_router_details
    • test_network_port_vm
    • test_network_port_container
    • test_network_port_l2_vm
    • test_network_port_l2_container

The global fixture _setup_provider was changed, but I didn't find where it's used.
The global fixture _has_no_providers was changed, but I didn't find where it's used.
The global fixture service_vm is used in the following files:

  • cfme/tests/automate/custom_button/test_service_objects.py
  • cfme/tests/automate/custom_button/test_service_vm_custom_button.py
    • test_custom_button_display_service_vm
    • test_custom_button_automate_service_vm
  • cfme/tests/intelligence/reports/test_reports.py
    • edit_service_name
  • cfme/tests/services/test_add_remove_vm_to_service.py
    • test_add_vm_to_service
  • cfme/tests/services/test_dialog_element_in_catalog.py
  • cfme/tests/services/test_myservice.py
    • test_retire_service_ui
    • test_retire_service_on_date
    • test_crud_set_ownership_and_edit_tags
    • test_download_file
    • test_service_link
    • test_retire_service_with_retired_vm
  • cfme/tests/services/test_service_manual_approval.py
    • test_service_retire_manual_approval

The global fixture generic_service is used in the following files:

  • cfme/tests/automate/custom_button/test_catalog_custom_button.py
    • test_custom_button_unassigned_behavior_catalog_level
  • cfme/tests/services/test_dynamicdd_dialogelement.py
    • test_dynamic_submit_cancel_button_service
  • cfme/tests/services/test_myservice.py
    • test_load_service_with_button
  • cfme/tests/ssui/test_ssui_service_catalogs.py
    • test_refresh_ssui_page

The global fixture template is used in the following files:

  • cfme/tests/automate/test_ansible_tower_automate.py
  • cfme/tests/cloud/test_providers.py
  • cfme/tests/cloud_infra_common/test_cloud_init_provisioning.py
  • cfme/tests/cloud_infra_common/test_genealogy.py
  • cfme/tests/cloud_infra_common/test_provisioning.py
  • cfme/tests/cloud_infra_common/test_vm_instance_analysis.py
  • cfme/tests/cloud_infra_common/test_vm_ownership.py
  • cfme/tests/configure/test_access_control.py
  • cfme/tests/infrastructure/test_delete_infra_object.py
  • cfme/tests/infrastructure/test_kubevirt.py
  • cfme/tests/infrastructure/test_provisioning_dialog.py
    • _provisioner
  • cfme/tests/infrastructure/test_provisioning_rest.py
  • cfme/tests/infrastructure/test_scvmm_specific.py
  • cfme/tests/infrastructure/test_vm_power_control.py
  • cfme/tests/infrastructure/test_vmware_provider.py
  • cfme/tests/infrastructure/test_webmks_console.py
  • cfme/tests/integration/test_ldap_auth.py
  • cfme/tests/intelligence/test_reports_with_timelines.py
  • cfme/tests/networks/test_provision_to_virtual_network.py
  • cfme/tests/pod/test_appliance_crud.py
  • cfme/tests/services/test_ansible_workflow_servicecatalogs.py
  • cfme/tests/services/test_config_provider_servicecatalogs.py
  • cfme/tests/services/test_different_dialogs_in_catalogs.py
  • cfme/tests/services/test_iso_service_catalogs.py
  • cfme/tests/services/test_orchestration_template.py
  • cfme/tests/services/test_provision_stack.py
  • cfme/tests/services/test_rest_services.py
  • cfme/tests/services/test_service_catalogs.py
  • cfme/tests/test_replication.py

The global fixture v2v_provider_setup is used in the following files:

  • cfme/tests/cloud_infra_common/test_quota_with_multiple_providers.py
    • test_show_quota_used_on_tenant_screen

The global fixture delete_conversion_hosts is used in the following files:

  • cfme/tests/v2v/test_conversion_host_ui.py
    • test_add_conversion_host_ui_crud
  • cfme/tests/v2v/test_v2v_migrations_ui.py
    • test_migration_with_no_conversion

The global fixture generate_version_files was changed, but I didn't find where it's used.
The local fixture appliance_police is used in the following files:

  • cfme/test_framework/appliance_police.py

The local fixture policy_for_testing is used in the following files:

  • cfme/tests/control/test_actions.py
    • test_action_start_virtual_machine_after_stopping
    • test_action_stop_virtual_machine_after_starting
    • test_action_suspend_virtual_machine_after_starting
    • test_action_prevent_event
    • test_action_prevent_vm_retire
    • test_action_prevent_ssa
    • test_action_power_on_logged
    • test_action_power_on_audit
    • test_action_create_snapshot_and_delete_last
    • test_action_create_snapshots_and_delete_them
    • test_action_tag
    • test_action_untag

The local fixture alert_profile is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_automate.py
    • test_alert_run_ansible_playbook

The local fixture repository is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_rest.py
    • test_edit_repository
    • test_delete_repository_from_detail
    • test_delete_repository_from_collection
    • test_payloads_collection
    • test_authentications_subcollection
    • test_payloads_subcollection

The local fixture ansible_policy_linked_vm is used in the following files:

  • cfme/tests/ansible/test_embedded_ansible_services.py

The local fixture setup_objs is used in the following files:

  • cfme/tests/automate/custom_button/test_cloud_objects.py
    • test_custom_button_display_cloud_obj
    • test_custom_button_dialog_cloud_obj
    • test_custom_button_automate_cloud_obj
    • test_custom_button_events_cloud_obj

The local fixture setup_obj is used in the following files:

  • cfme/tests/automate/custom_button/test_infra_objects.py
    • test_custom_button_display_infra_obj
    • test_custom_button_automate_infra_obj
    • test_custom_button_dialog_infra_obj
    • test_custom_button_open_url_infra_obj
    • test_custom_button_events_infra_obj

The local fixture some_dialogs is used in the following files:

  • cfme/tests/automate/test_customization_paginator.py
    • test_paginator_service_dialogs

The local fixture appliance_preupdate is used in the following files:

  • cfme/tests/test_db_migrate.py
    • test_upgrade_single_inplace

The local fixture connect_az_account is used in the following files:

  • cfme/tests/cloud/test_providers.py
    • test_create_azure_vm_from_azure_image

The local fixture cfme_vhd is used in the following files:

  • cfme/tests/infrastructure/test_scvmm_specific.py
    • scvmm_appliance

The local fixture upload_image_to_azure is used in the following files:

  • cfme/tests/cloud/test_providers.py
    • test_create_azure_vm_from_azure_image

The local fixture vm_ip is used in the following files:

  • cfme/tests/cloud/test_providers.py

The local fixture set_child_tenant_quota is used in the following files:

  • cfme/tests/infrastructure/test_child_tenant.py

The local fixture set_project_quota is used in the following files:

  • cfme/tests/infrastructure/test_project_quota.py

The local fixture new_group_child is used in the following files:

  • cfme/tests/cloud/test_quota.py
    • new_user_child

The local fixture new_group_project is used in the following files:

  • cfme/tests/cloud/test_quota.py
    • new_user_project

The local fixture set_roottenant_quota is used in the following files:

  • cfme/tests/infrastructure/test_tenant_quota.py
    • test_tenant_quota_enforce_via_lifecycle_infra
    • test_tenant_quota_enforce_via_service_infra
    • test_tenant_quota_vm_reconfigure
    • test_vm_migration_after_assigning_tenant_quota

The local fixture tag_mapping_items is used in the following files:

  • cfme/tests/cloud/test_tag_mapping.py
    • test_labels_update

The local fixture set_default is used in the following files:

  • cfme/tests/infrastructure/test_tenant_quota.py
    • catalog_item

The local fixture get_service is used in the following files:

  • cfme/tests/cloud_infra_common/test_custom_attributes_rest.py
    • get_resource

The local fixture schedule_ssa is used in the following files:

  • cfme/tests/cloud_infra_common/test_vm_instance_analysis.py
    • test_ssa_schedule

The local fixture vm_crud is used in the following files:

  • cfme/tests/cloud_infra_common/test_vm_ownership.py
    • test_form_button_validation
    • test_user_ownership_crud
    • test_group_ownership_on_user_only_role
    • test_group_ownership_on_user_or_group_role
    • test_template_set_ownership

The local fixture setup_openldap_user_group is used in the following files:

  • cfme/tests/configure/test_access_control.py

The local fixture configured_depot is used in the following files:

  • cfme/tests/configure/test_log_depot_operation.py
    • test_collect_log_depot

The local fixture metrics_up_and_running is used in the following files:

  • cfme/tests/containers/test_ad_hoc_metrics.py
    • test_ad_hoc_metrics_overview
    • test_ad_hoc_metrics_select_filter

The local fixture enable_capacity_and_utilization is used in the following files:

  • cfme/tests/containers/test_basic_metrics.py

The local fixture kibana_logging_url is used in the following files:

  • cfme/tests/containers/test_logging.py
    • test_external_logging_activated

The local fixture set_cve_location is used in the following files:

  • cfme/tests/containers/test_ssa_set_cve_image_inspector_per_provider.py

The local fixture set_image_inspector_registry is used in the following files:

  • cfme/tests/containers/test_ssa_set_cve_image_inspector_per_provider.py

The local fixture compliance_policy is used in the following files:

  • cfme/tests/control/test_actions.py

The local fixture setup_disk_usage_alert is used in the following files:

  • cfme/tests/control/test_bugs.py
    • test_alert_for_disk_usage

The local fixture default_alerts is used in the following files:

  • cfme/tests/control/test_default_alerts.py
    • test_default_alerts

The local fixture rails_delete_filter is used in the following files:

  • cfme/tests/infrastructure/test_advanced_search_providers.py
    • test_provider_filter_save_cancel
    • test_provider_filter_save_and_load
    • test_provider_filter_save_and_cancel_load
    • test_delete_button_should_appear_after_save_provider

The local fixture expression_for_vms_subset is used in the following files:

  • cfme/tests/infrastructure/test_advanced_search_vms.py
    • test_vm_filter_save_cancel

The local fixture new_group is used in the following files:

  • cfme/tests/infrastructure/test_project_quota.py
    • new_user

The local fixture authentications is used in the following files:

  • cfme/tests/infrastructure/test_config_management_rest.py
    • _check_edited_authentications
    • test_query_authentications_attributes
    • test_authentications_edit_single
    • test_authentications_edit_multiple
    • test_delete_authentications_from_detail_post
    • test_delete_authentications_from_detail_delete
    • test_delete_authentications_from_collection

The local fixture host_ips is used in the following files:

  • cfme/tests/infrastructure/test_host.py
    • test_discover_host

The local fixture temp_vm is used in the following files:

  • cfme/tests/infrastructure/test_kubevirt.py
    • test_vm_power_management

The local fixture set_parent_tenant_quota is used in the following files:

  • cfme/tests/infrastructure/test_quota.py
    • test_user_quota_diff_groups

The local fixture scvmm_appliance is used in the following files:

  • cfme/tests/infrastructure/test_scvmm_specific.py
    • test_create_appliance_on_scvmm_using_the_vhd_image

The local fixture mark_vm_as_appliance is used in the following files:

  • cfme/tests/infrastructure/test_timelines.py
    • test_infra_timeline_diagnostic

The local fixture vm_ownership is used in the following files:

  • cfme/tests/intelligence/reports/test_validate_chargeback_report.py
    • resource_usage
    • chargeback_report_default
    • chargeback_report_custom

The local fixture resource_usage is used in the following files:

  • cfme/tests/intelligence/chargeback/test_chargeback_long_term_rates.py
    • chargeback_costs_custom

The local fixture chargeback_report_custom is used in the following files:

  • cfme/tests/intelligence/reports/test_validate_chargeback_report.py
    • test_validate_custom_rate_cpu_usage_cost
    • test_validate_custom_rate_memory_usage_cost
    • test_validate_custom_rate_network_usage_cost
    • test_validate_custom_rate_disk_usage_cost
    • test_validate_custom_rate_storage_usage_cost

The local fixture resource_alloc is used in the following files:

  • cfme/tests/intelligence/chargeback/test_resource_allocation.py
    • chargeback_costs_custom
    • generic_test_resource_alloc
    • test_verify_alloc_memory
    • test_verify_alloc_cpu
    • test_verify_alloc_storage

The local fixture metering_report is used in the following files:

  • cfme/tests/intelligence/reports/test_metering_report.py
    • test_validate_cpu_usage
    • test_validate_memory_usage
    • test_validate_network_usage
    • test_validate_disk_usage
    • test_validate_storage_usage

The local fixture chargeback_report_default is used in the following files:

  • cfme/tests/intelligence/reports/test_validate_chargeback_report.py
    • test_validate_default_rate_cpu_usage_cost
    • test_validate_default_rate_disk_usage_cost

The local fixture network is used in the following files:

  • cfme/tests/networks/test_provision_to_virtual_network.py

The local fixture private_flavor is used in the following files:

  • cfme/tests/openstack/cloud/test_flavors.py
    • instance_with_private_flavor
    • test_flavors_details_from_list_view
    • test_flavor_details

The local fixture volume is used in the following files:

  • cfme/tests/storage/test_volume_snapshot.py
    • snapshot
    • test_storage_snapshot_create_cancelled_validation
    • test_storage_snapshot_create_reset_validation
    • test_storage_volume_snapshot_crud

The local fixture volume_backup is used in the following files:

  • cfme/tests/openstack/cloud/test_volume_backup.py
    • incremental_backup
    • attached_volume
    • test_create_volume_backup
    • test_restore_volume_backup

The local fixture template_tags is used in the following files:

  • cfme/tests/pod/test_appliance_crud.py
    • temp_extdb_pod_appliance
    • temp_pod_ansible_appliance

The local fixture create_external_database is used in the following files:

  • cfme/tests/pod/test_appliance_crud.py

The local fixture temp_pod_ansible_appliance is used in the following files:

  • cfme/tests/pod/test_appliance_crud.py

The local fixture new_ssa_image is used in the following files:

  • cfme/tests/pod/test_appliance_crud.py
    • temp_ssa_pod_appliance

The local fixture ansible_workflow_catitem is used in the following files:

  • cfme/tests/services/test_ansible_workflow_servicecatalogs.py
    • test_tower_workflow_item
    • test_retire_ansible_workflow

The local fixture catalog_item is used in the following files:

  • cfme/tests/services/test_config_provider_servicecatalogs.py
    • test_order_tower_catalog_item
    • test_retire_ansible_service

The local fixture generated_request is used in the following files:

  • cfme/tests/services/test_operations.py
    • test_services_request_direct_url
    • test_copy_request

The local fixture stack_data is used in the following files:

  • cfme/tests/services/test_provision_stack.py
    • service_catalogs
    • stack_created
    • order_stack

The local fixture catalog_bundle is used in the following files:

  • cfme/tests/services/test_rest_services.py
    • test_order_catalog_bundle

The local fixture new_compute_rate is used in the following files:

  • cfme/tests/ssui/test_ssui_dashboard.py
    • assign_chargeback_rate

The local fixture import_tags is used in the following files:

  • cfme/tests/webui/test_general_ui.py
    • test_configuration_large_number_of_tags

The local fixture create_20k_vms is used in the following files:

  • cfme/tests/webui/test_general_ui.py
    • test_infrastructure_filter_20k_vms

The local fixture search_filter_obj is used in the following files:

  • cfme/tests/webui/test_rest.py
    • test_delete_advanced_search_filter_from_collection
    • test_delete_advanced_search_filter_from_detail

Please, consider creating a PRT run to make sure your fixture changes do not break existing usage 😃

@dajoRH dajoRH added the lint-ok label Mar 31, 2020
@mshriver mshriver changed the title Pre commit flake [RFR] Apply pyupgrade Mar 31, 2020
@@ -393,7 +393,7 @@ class Credential(BaseEntity, Taggable):
# is also problematic for attrs

def __init__(self, collection, name, credential_type, **credentials):
super(Credential, self).__init__(collection)
super().__init__(collection)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah this is part of the pyupgrade conversion, not something I changed directly.

@jawatts jawatts merged commit f6f0b52 into ManageIQ:master Mar 31, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants