diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index cc78000..c94d5f8 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -15,7 +15,7 @@ repos: - id: end-of-file-fixer - repo: https://github.com/astral-sh/ruff-pre-commit - rev: v0.15.22 + rev: v0.16.2 hooks: - id: ruff-check types_or: [python, pyi, jupyter] diff --git a/notebook.ipynb b/notebook.ipynb index 204590a..0d49881 100644 --- a/notebook.ipynb +++ b/notebook.ipynb @@ -7,8 +7,8 @@ "metadata": {}, "outputs": [], "source": [ - "import pytest\n", "import ipytest\n", + "import pytest\n", "\n", "ipytest.autoconfig()" ] diff --git a/test_area.py b/test_area.py index 2afa735..6e65abd 100644 --- a/test_area.py +++ b/test_area.py @@ -1,6 +1,7 @@ -from area import area_of_square, area_of_rectangle import pytest +from area import area_of_rectangle, area_of_square + def test_area_of_square(): # for integers, we can simply assert they are equal diff --git a/test_text.py b/test_text.py index 09d1473..eb7b0f3 100644 --- a/test_text.py +++ b/test_text.py @@ -1,15 +1,15 @@ -from text import count_lines, count_characters, count_bytes import pytest import requests +from text import count_bytes, count_characters, count_lines + @pytest.fixture def test_file_generator(tmp_path): def _test_file(n_lines): filename = tmp_path / "temp_file.txt" with open(filename, "w") as f: - for _ in range(n_lines): - f.write("hello\n") + f.writelines("hello\n" for _ in range(n_lines)) return filename return _test_file