diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 60c2d39..4594ed9 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -22,7 +22,7 @@ repos: - id: requirements-txt-fixer - id: check-added-large-files - repo: https://github.com/psf/black-pre-commit-mirror - rev: 24.4.2 + rev: 24.8.0 hooks: - id: black - repo: https://github.com/Pierre-Sassoulas/black-disable-checker @@ -34,7 +34,7 @@ repos: hooks: - id: isort - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.5.6 + rev: v0.6.3 hooks: - id: ruff args: [--fix, --exit-non-zero-on-fix] diff --git a/tests/algorithms/sorting_test.py b/tests/algorithms/sorting_test.py index 03ce656..5903533 100755 --- a/tests/algorithms/sorting_test.py +++ b/tests/algorithms/sorting_test.py @@ -16,12 +16,12 @@ from nrw.datastructures import ComparableContentT, List -@pytest.fixture() +@pytest.fixture def empty_list() -> List[int]: return List() -@pytest.fixture() +@pytest.fixture def sorted_list() -> List[int]: lst: List[int] = List() lst.append(1) @@ -33,7 +33,7 @@ def sorted_list() -> List[int]: return lst -@pytest.fixture() +@pytest.fixture def unsorted_list() -> List[int]: lst: List[int] = List() lst.append(3) diff --git a/tests/algorithms/traversal_test.py b/tests/algorithms/traversal_test.py index c361ba2..03f95de 100755 --- a/tests/algorithms/traversal_test.py +++ b/tests/algorithms/traversal_test.py @@ -13,7 +13,7 @@ from nrw.datastructures import List -@pytest.fixture() +@pytest.fixture def bst() -> BinarySearchTree[int]: tree: BinarySearchTree[int] = BinarySearchTree() tree.insert(5) @@ -25,7 +25,7 @@ def bst() -> BinarySearchTree[int]: return tree -@pytest.fixture() +@pytest.fixture def binary_tree() -> BinaryTree[int]: tree: BinaryTree[int] = BinaryTree() tree.content = 5 diff --git a/tests/database/msaccess_test.py b/tests/database/msaccess_test.py index 4317cee..0431ad4 100755 --- a/tests/database/msaccess_test.py +++ b/tests/database/msaccess_test.py @@ -18,7 +18,7 @@ from pathlib import Path -@pytest.fixture() +@pytest.fixture def msaccess_db(tmp_path: Path) -> Iterator[str]: test_db: Path = tmp_path / "test.accdb" test_db.touch() diff --git a/tests/datastructures/binary_search_tree_test.py b/tests/datastructures/binary_search_tree_test.py index 503b102..65dfd70 100755 --- a/tests/datastructures/binary_search_tree_test.py +++ b/tests/datastructures/binary_search_tree_test.py @@ -8,12 +8,12 @@ from nrw.datastructures._binary_search_tree import _BSTNode -@pytest.fixture() +@pytest.fixture def empty_bst() -> BinarySearchTree[int]: return BinarySearchTree() -@pytest.fixture() +@pytest.fixture def sample_bst() -> BinarySearchTree[int]: bst: BinarySearchTree[int] = BinarySearchTree() bst._node = _BSTNode(1) diff --git a/tests/datastructures/edge_test.py b/tests/datastructures/edge_test.py index eb9d940..f8aeedf 100755 --- a/tests/datastructures/edge_test.py +++ b/tests/datastructures/edge_test.py @@ -7,7 +7,7 @@ from nrw.datastructures import Edge, Vertex -@pytest.fixture() +@pytest.fixture def sample_edge() -> Edge: vertex_a: Vertex = Vertex("A") vertex_b: Vertex = Vertex("B") diff --git a/tests/datastructures/graph_test.py b/tests/datastructures/graph_test.py index 27d044e..be776cb 100755 --- a/tests/datastructures/graph_test.py +++ b/tests/datastructures/graph_test.py @@ -7,7 +7,7 @@ from nrw.datastructures import Edge, Graph, List, Vertex -@pytest.fixture() +@pytest.fixture def graph() -> Graph: return Graph() diff --git a/tests/datastructures/list_test.py b/tests/datastructures/list_test.py index b080a34..16d0d76 100755 --- a/tests/datastructures/list_test.py +++ b/tests/datastructures/list_test.py @@ -8,17 +8,17 @@ from nrw.datastructures._list import _ListNode -@pytest.fixture() +@pytest.fixture def sample_node() -> _ListNode[int]: return _ListNode(1) -@pytest.fixture() +@pytest.fixture def empty_list() -> List[int]: return List() -@pytest.fixture() +@pytest.fixture def sample_list() -> List[int]: lst: List[int] = List() lst.append(1) diff --git a/tests/network_test.py b/tests/network_test.py index c4849cf..aee23ea 100755 --- a/tests/network_test.py +++ b/tests/network_test.py @@ -57,7 +57,7 @@ def process_message(self, message: str) -> None: assert message == "Hello to you" -@pytest.mark.networktest() +@pytest.mark.networktest def test_connection_without_running_server() -> None: conn: Connection = Connection(LOCALHOST, random_port()) conn.send("Hello") @@ -65,7 +65,7 @@ def test_connection_without_running_server() -> None: conn.close() -@pytest.mark.networktest() +@pytest.mark.networktest def test_client_without_running_server() -> None: client: HelloClient = HelloClient(LOCALHOST, random_port()) assert not client.is_connected @@ -74,7 +74,7 @@ def test_client_without_running_server() -> None: assert not client.is_connected -@pytest.mark.networktest() +@pytest.mark.networktest def test_close_connection_first() -> None: port: int = random_port() server: HelloServer = HelloServer(port=port) @@ -92,7 +92,7 @@ def test_close_connection_first() -> None: assert not server.is_open -@pytest.mark.networktest() +@pytest.mark.networktest def test_close_server_first() -> None: port: int = random_port() server: HelloServer = HelloServer(port=port) @@ -110,7 +110,7 @@ def test_close_server_first() -> None: assert not server.is_open -@pytest.mark.networktest() +@pytest.mark.networktest def test_close_client_connection_first() -> None: port: int = random_port() server: HelloServer = HelloServer(port) @@ -140,7 +140,7 @@ def test_close_client_connection_first() -> None: assert not client.is_connected -@pytest.mark.networktest() +@pytest.mark.networktest def test_close_server_connection_first() -> None: port: int = random_port() server: HelloServer = HelloServer(port) @@ -171,7 +171,7 @@ def test_close_server_connection_first() -> None: assert not client.is_connected -@pytest.mark.networktest() +@pytest.mark.networktest def test_server_with_two_connected_clients() -> None: port: int = random_port() server: HelloServer = HelloServer(port)