diff --git a/test/test_add_zones.py b/test/test_add_zones.py index 28853adc..6b17e6b7 100644 --- a/test/test_add_zones.py +++ b/test/test_add_zones.py @@ -1,7 +1,5 @@ import pytest from time import sleep -from aequilibrae.utils.db_utils import commit_and_close -from aequilibrae.project.database_connection import database_connection from qgis.core import QgsProject from qaequilibrae.modules.project_procedures.adds_zones_dialog import AddZonesDialog @@ -18,9 +16,6 @@ def test_add_zones(pt_project, create_polygons_layer): sleep(2) - with commit_and_close(database_connection("network")) as conn: - num_zones = conn.execute("select count(zone_id) from zones").fetchone()[0] - - assert num_zones == 3 + assert len(pt_project.project.zoning.all_zones()) == 3 QgsProject.instance().clear() diff --git a/test/test_adds_centroid_connector.py b/test/test_adds_centroid_connector.py index 24505409..d8fc17c3 100644 --- a/test/test_adds_centroid_connector.py +++ b/test/test_adds_centroid_connector.py @@ -4,7 +4,7 @@ from aequilibrae.utils.db_utils import read_and_close from aequilibrae.project.database_connection import database_connection from qgis.core import QgsProject, QgsVectorLayer, QgsField, QgsFeature -from qgis.core import QgsFeature, QgsPointXY, QgsGeometry +from qgis.core import QgsPointXY, QgsGeometry from qgis.PyQt.QtCore import QVariant from qaequilibrae.modules.network.adds_connectors_dialog import AddConnectorsDialog diff --git a/test/test_load_matrix.py b/test/test_load_matrix.py index 670d8e10..8ba6023a 100644 --- a/test/test_load_matrix.py +++ b/test/test_load_matrix.py @@ -1,6 +1,7 @@ from PyQt5.QtCore import QTimer, QVariant import numpy as np from qgis.core import QgsProject, QgsVectorLayer, QgsField, QgsFeature + from qaequilibrae.modules.matrix_procedures.load_matrix_dialog import LoadMatrixDialog diff --git a/test/test_load_project_data.py b/test/test_load_project_data.py index 1d14b455..b36e1d30 100644 --- a/test/test_load_project_data.py +++ b/test/test_load_project_data.py @@ -1,9 +1,8 @@ import pytest -from os.path import join -from shutil import copyfile from PyQt5.QtCore import Qt from qgis.core import QgsProject from qgis.PyQt.QtWidgets import QTabWidget + from qaequilibrae.modules.matrix_procedures.load_project_data import LoadProjectDataDialog diff --git a/test/test_processing_provider.py b/test/test_processing_provider.py index 39315919..8dbc7ddd 100644 --- a/test/test_processing_provider.py +++ b/test/test_processing_provider.py @@ -5,13 +5,11 @@ import sqlite3 from os.path import isfile, join from os import makedirs -from shutil import copyfile from shapely.geometry import Point from aequilibrae.matrix import AequilibraeMatrix from aequilibrae.project import Project from qgis.core import QgsApplication, QgsProcessingContext, QgsProcessingFeedback -from qgis.core import QgsProject, QgsVectorLayer, QgsCoordinateReferenceSystem -from qgis.core import QgsField +from qgis.core import QgsProject, QgsField from PyQt5.QtCore import QVariant from qaequilibrae.modules.common_tools.data_layer_from_dataframe import layer_from_dataframe diff --git a/test/test_pt_procedures.py b/test/test_pt_procedures.py index 8b059402..b329a2ee 100644 --- a/test/test_pt_procedures.py +++ b/test/test_pt_procedures.py @@ -4,6 +4,7 @@ from datetime import datetime from aequilibrae.transit import Transit from PyQt5.QtCore import QTimer + from qaequilibrae.modules.public_transport_procedures.gtfs_feed import GTFSFeed from qaequilibrae.modules.public_transport_procedures.gtfs_importer import GTFSImporter diff --git a/test/test_routing.py b/test/test_routing.py index 9dd8a6e4..c2f96dce 100644 --- a/test/test_routing.py +++ b/test/test_routing.py @@ -1,7 +1,7 @@ import pytest +from qgis.core import QgsProject from qaequilibrae.modules.routing_procedures.tsp_dialog import TSPDialog -from qgis.core import QgsProject @pytest.mark.parametrize("in_selection", [False, True]) diff --git a/test/test_shortest_path.py b/test/test_shortest_path.py index a5e2bc0a..16fd2fb2 100644 --- a/test/test_shortest_path.py +++ b/test/test_shortest_path.py @@ -1,5 +1,6 @@ from PyQt5.QtCore import Qt, QTimer from PyQt5.QtWidgets import QApplication + from qaequilibrae.modules.paths_procedures.show_shortest_path_dialog import ShortestPathDialog diff --git a/test/test_simple_tag.py b/test/test_simple_tag.py index 74d156bd..ac14a280 100644 --- a/test/test_simple_tag.py +++ b/test/test_simple_tag.py @@ -2,7 +2,7 @@ from aequilibrae.utils.db_utils import commit_and_close from aequilibrae.project.database_connection import database_connection from qgis.core import QgsProject, QgsVectorLayer, QgsField, QgsFeature -from qgis.core import QgsFeature, QgsPointXY, QgsGeometry +from qgis.core import QgsPointXY, QgsGeometry from qgis.PyQt.QtCore import QVariant from qaequilibrae.modules.gis.simple_tag_dialog import SimpleTagDialog