Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion db/db.columns/testsuite/test_dbcolumns.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from grass.gunittest.case import TestCase
from grass.gunittest.main import test
from grass.script.core import read_command, parse_command
from grass.script.core import parse_command, read_command

output_plain = """cat
OBJECTID
Expand Down
2 changes: 1 addition & 1 deletion db/db.connect/testsuite/test_db_connect.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from grass.gunittest.case import TestCase
from grass.gunittest.main import test
from grass.script.core import read_command, parse_command
from grass.script.core import parse_command, read_command


class TestDbConnect(TestCase):
Expand Down
4 changes: 2 additions & 2 deletions display/d.mon/render_cmd.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
#!/usr/bin/env python3
import glob
import os
import sys
import glob
import tempfile
from pathlib import Path

from grass.exceptions import CalledModuleError
from grass.script import core as grass
from grass.script import task as gtask
from grass.exceptions import CalledModuleError

non_rendering_modules = (
"d.colorlist",
Expand Down
2 changes: 1 addition & 1 deletion display/d.text/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# Author: Owen Smith - Rewritten from test.pl by Huidae Cho
# Run: d.mon start=wx0 && ./test.py | d.text at=0,100
import math
from pathlib import Path
import re
from pathlib import Path

# Quiet black syntax checking for fonts and colors to keep the code printed to
# the display vertically short.
Expand Down
2 changes: 1 addition & 1 deletion general/g.findfile/tests/test_g_findfile.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import os
import pytest
from pathlib import Path

import grass.script as gs
import pytest


@pytest.fixture(scope="module")
Expand Down
2 changes: 1 addition & 1 deletion lib/gis/tests/lib_gis_env_test.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""Test environment and GIS environment functions"""

import json
import os
import subprocess
import sys
import json
from textwrap import dedent

import pytest
Expand Down
1 change: 0 additions & 1 deletion lib/gis/tests/lib_gis_parser_json_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import pytest


from grass.exceptions import CalledModuleError


Expand Down
2 changes: 1 addition & 1 deletion lib/gis/testsuite/gis_lib_env_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@author Soeren Gebbert
"""

from grass.gunittest.case import TestCase
import grass.lib.gis as libgis
from grass.gunittest.case import TestCase


class GisLibraryTestEnv(TestCase):
Expand Down
3 changes: 1 addition & 2 deletions lib/gis/testsuite/gis_lib_str_color.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,10 @@

from ctypes import byref, c_int

import grass.lib.gis as libgis
from grass.gunittest.case import TestCase
from grass.gunittest.main import test

import grass.lib.gis as libgis


class StringToColorTestCase(TestCase):
"""Test C function G_str_to_color() from gis library"""
Expand Down
3 changes: 1 addition & 2 deletions lib/gis/testsuite/gis_lib_tokenize.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
@author Vaclav Petras
"""

import grass.lib.gis as libgis
from grass.gunittest.case import TestCase
from grass.gunittest.main import test

import grass.lib.gis as libgis

# TODO: add tests for content (now testing only number of items)


Expand Down
2 changes: 1 addition & 1 deletion lib/gis/testsuite/test_gis_lib_getl.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@
@author Vaclav Petras
"""

import os
import ctypes
import os
import unittest
from pathlib import Path

Expand Down
3 changes: 2 additions & 1 deletion lib/gis/testsuite/test_parser_json.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,12 @@
@author Soeren Gebbert
"""

import json
import subprocess

from grass.gunittest.case import TestCase
from grass.gunittest.utils import xfail_windows
from grass.script import decode
import json


class TestParserJson(TestCase):
Expand Down
10 changes: 4 additions & 6 deletions lib/imagery/testsuite/test_imagery_find.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,19 +14,17 @@

from grass.gunittest.case import TestCase
from grass.gunittest.main import test

from grass.script.core import tempname
from grass.pygrass import utils
from grass.pygrass.gis import Mapset

from grass.lib.gis import G_mapset_path
from grass.lib.imagery import (
I_SIGFILE_TYPE_LIBSVM,
I_SIGFILE_TYPE_SIG,
I_SIGFILE_TYPE_SIGSET,
I_SIGFILE_TYPE_LIBSVM,
I_find_signature,
I_find_signature2,
)
from grass.pygrass import utils
from grass.pygrass.gis import Mapset
from grass.script.core import tempname


class FindSignatureTestCase(TestCase):
Expand Down
30 changes: 14 additions & 16 deletions lib/imagery/testsuite/test_imagery_sigfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,36 +9,34 @@
for details
"""

import stat
import ctypes
import os
import shutil
import stat
from pathlib import Path

from grass.gunittest.case import TestCase
from grass.gunittest.main import test

from grass.script.core import tempname
from grass.pygrass import utils
from grass.pygrass.gis import Mapset

from grass.lib.gis import G_mapset_path
from grass.lib.raster import Rast_write_semantic_label
from grass.lib.imagery import (
Signature,
Ref,
I_init_signatures,
I_new_signature,
I_add_file_to_group_ref,
I_fopen_signature_file_new,
I_write_signatures,
I_fopen_signature_file_old,
I_read_signatures,
I_sort_signatures_by_semantic_label,
I_free_group_ref,
I_free_signatures,
I_init_group_ref,
I_add_file_to_group_ref,
I_free_group_ref,
I_init_signatures,
I_new_signature,
I_read_signatures,
I_sort_signatures_by_semantic_label,
I_write_signatures,
Ref,
Signature,
)
from grass.lib.raster import Rast_write_semantic_label
from grass.pygrass import utils
from grass.pygrass.gis import Mapset
from grass.script.core import tempname


class SignatureFileTestCase(TestCase):
Expand Down
30 changes: 14 additions & 16 deletions lib/imagery/testsuite/test_imagery_signature_management.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,40 +9,38 @@
for details
"""

import ctypes
import os
import shutil
import ctypes
from pathlib import Path

import grass.script as gs
from grass.gunittest.case import TestCase
from grass.gunittest.main import test
from grass.gunittest.utils import xfail_windows

from grass.script.core import tempname
import grass.script as gs
from grass.pygrass import utils
from grass.pygrass.gis import Mapset, make_mapset
from pathlib import Path

from grass.lib.gis import (
G_mapset_path,
G_make_mapset,
G_reset_mapsets,
GNAME_MAX,
HOST_DIRSEP,
G_make_mapset,
G_mapset_path,
G_reset_mapsets,
)
from grass.lib.imagery import (
I_SIGFILE_TYPE_LIBSVM,
I_SIGFILE_TYPE_SIG,
I_SIGFILE_TYPE_SIGSET,
I_SIGFILE_TYPE_LIBSVM,
I_find_signature,
I_signatures_remove,
I_signatures_copy,
I_signatures_rename,
I_signatures_list_by_type,
I_free_signatures_list,
I_get_signatures_dir,
I_make_signatures_dir,
I_signatures_copy,
I_signatures_list_by_type,
I_signatures_remove,
I_signatures_rename,
)
from grass.pygrass import utils
from grass.pygrass.gis import Mapset, make_mapset
from grass.script.core import tempname


class GetSignaturesDirTestCase(TestCase):
Expand Down
26 changes: 12 additions & 14 deletions lib/imagery/testsuite/test_imagery_sigsetfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,37 +9,35 @@
for details
"""

import stat
import ctypes
import os
import shutil
import stat
from pathlib import Path

from grass.gunittest.case import TestCase
from grass.gunittest.main import test

from grass.script.core import tempname
from grass.pygrass import utils
from grass.pygrass.gis import Mapset

from grass.lib.gis import G_mapset_path
from grass.lib.raster import Rast_write_semantic_label
from grass.lib.imagery import (
SigSet,
I_add_file_to_group_ref,
I_fopen_sigset_file_new,
I_fopen_sigset_file_old,
I_free_group_ref,
I_init_group_ref,
I_InitSigSet,
I_NewClassSig,
I_NewSubSig,
I_WriteSigSet,
I_ReadSigSet,
I_SortSigSetBySemanticLabel,
I_fopen_sigset_file_new,
I_fopen_sigset_file_old,
I_WriteSigSet,
Ref,
I_init_group_ref,
I_add_file_to_group_ref,
I_free_group_ref,
ReturnString,
SigSet,
)
from grass.lib.raster import Rast_write_semantic_label
from grass.pygrass import utils
from grass.pygrass.gis import Mapset
from grass.script.core import tempname


class SigSetFileTestCase(TestCase):
Expand Down
1 change: 0 additions & 1 deletion lib/init/grass.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,6 @@
import tempfile
import unicodedata
import uuid

from pathlib import Path
from typing import TYPE_CHECKING, Literal, NoReturn

Expand Down
3 changes: 1 addition & 2 deletions lib/init/testsuite/test_grass_tmp_mapset.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,10 @@
for details.
"""

import unittest
import os
import shutil
import subprocess

import unittest

# Note that unlike rest of GRASS, here we are using unittest package
# directly. The grass.gunittest machinery for mapsets is not needed here.
Expand Down
6 changes: 3 additions & 3 deletions lib/raster/tests/lib_raster_reclass_test.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
import os
from pathlib import Path
from io import StringIO
from pathlib import Path

import pytest

from grass.script import MaskManager
from grass.tools import Tools
from grass.exceptions import CalledModuleError
from grass.experimental import MapsetSession
from grass.script import MaskManager
from grass.tools import Tools


def test_reclass_as_mask_correct_state(session):
Expand Down
3 changes: 1 addition & 2 deletions lib/raster/testsuite/rast_parse_color_rule.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,10 @@
for details
"""

from ctypes import byref, c_int, c_double
from ctypes import byref, c_double, c_int

from grass.gunittest.case import TestCase
from grass.gunittest.main import test

from grass.lib.raster import Rast_parse_color_rule, Rast_parse_color_rule_error


Expand Down
10 changes: 4 additions & 6 deletions lib/raster/testsuite/test_raster_metadata.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,16 @@

from grass.gunittest.case import TestCase
from grass.gunittest.main import test

from grass.script.core import tempname
from grass.pygrass.gis import Mapset
from grass.pygrass import utils

from grass.lib.gis import G_remove_misc
from grass.lib.raster import (
Rast_get_semantic_label_or_name,
Rast_legal_semantic_label,
Rast_read_semantic_label,
Rast_get_semantic_label_or_name,
Rast_write_semantic_label,
)
from grass.pygrass import utils
from grass.pygrass.gis import Mapset
from grass.script.core import tempname


class RastLegalBandIdTestCase(TestCase):
Expand Down
2 changes: 1 addition & 1 deletion lib/vector/Vlib/testsuite/test_vlib_box.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,8 @@
"""

import ctypes
import grass.lib.vector as libvect

import grass.lib.vector as libvect
from grass.gunittest.case import TestCase
from grass.gunittest.main import test

Expand Down
Loading
Loading