Skip to content

Commit

Permalink
Merge pull request #40 from cgahr/pre-commit-ci-update-config
Browse files Browse the repository at this point in the history
[pre-commit.ci] pre-commit autoupdate
  • Loading branch information
cgahr authored Sep 3, 2024
2 parents d033236 + a6b2ad6 commit 4be4b5b
Show file tree
Hide file tree
Showing 5 changed files with 19 additions and 19 deletions.
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -33,12 +33,12 @@ repos:
- id: codespell
args: []
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.5.6'
rev: 'v0.6.3'
hooks:
- id: ruff
- id: ruff-format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: 'v1.11.1'
rev: 'v1.11.2'
hooks:
- id: mypy
exclude: tests
Expand Down
2 changes: 1 addition & 1 deletion tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def _close_plots():
plt.close("all")


@pytest.fixture()
@pytest.fixture
def _show(pytestconfig):
yield
if pytestconfig.getoption("plot"):
Expand Down
14 changes: 7 additions & 7 deletions tests/test_10_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,26 +21,26 @@ def test_constants():


class TestConfig:
@pytest.fixture()
@pytest.fixture
def default(self, monkeypatch):
default = {"apple": 10, "egg": 1, "skyscraper": "a"}
monkeypatch.setattr(cfg, "DEFAULT_CONFIG", default)
return default

@pytest.fixture()
@pytest.fixture
def path(self, tmp_path, monkeypatch):
path = tmp_path / "directory" / "dir2" / "tmp.ini"
path.parent.mkdir(parents=True)
return path

@pytest.fixture()
@pytest.fixture
def config(self, default, path):
with path.open("w", encoding="utf-8") as fh:
json.dump(default, fh)

return cfg.Config(path)

@pytest.fixture()
@pytest.fixture
def mock_open(self, default, mocker):
return mocker.patch("latexplotlib._config.Config._open", return_value=default)

Expand Down Expand Up @@ -142,11 +142,11 @@ def test_config_path():


class TestSize:
@pytest.fixture()
@pytest.fixture
def height(self):
return 20

@pytest.fixture()
@pytest.fixture
def width(self):
return 10

Expand All @@ -158,7 +158,7 @@ def _patch_config(self, height, width, monkeypatch, mocker):
)
monkeypatch.setattr(cfg, "config", config)

@pytest.fixture()
@pytest.fixture
def size(self):
return cfg.Size()

Expand Down
10 changes: 5 additions & 5 deletions tests/test_20_cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_styles():


class TestPurgeOldStyles:
@pytest.fixture()
@pytest.fixture
def purged_str(self, monkeypatch):
s = "banana"
monkeypatch.setattr(cleanup, "_PURGED_OLD", s)
Expand All @@ -35,25 +35,25 @@ def fun():
self.assert_purged_true = fun
return default

@pytest.fixture()
@pytest.fixture
def styles_folder(self, monkeypatch):
styles_folder = "new"
monkeypatch.setattr(cleanup, "STYLES_FOLDER", styles_folder)
return styles_folder

@pytest.fixture()
@pytest.fixture
def new(self, tmp_path, styles_folder):
path = tmp_path / styles_folder
path.mkdir()
return path

@pytest.fixture()
@pytest.fixture
def stylelib(self, monkeypatch):
stylelib = "old"
monkeypatch.setattr(cleanup, "STYLELIB", stylelib)
return stylelib

@pytest.fixture()
@pytest.fixture
def old(self, tmp_path, stylelib):
path = tmp_path / stylelib
path.mkdir()
Expand Down
8 changes: 4 additions & 4 deletions tests/test_30_latexplotlib.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,11 +45,11 @@ def ncols(self, request):
def scale(self, request):
return request.param

@pytest.fixture()
@pytest.fixture
def width(self):
return 400

@pytest.fixture()
@pytest.fixture
def height(self):
return 300

Expand Down Expand Up @@ -79,7 +79,7 @@ def test_str_ratio(self, nrows, ncols, scale, width, aspect):
assert res_width <= width_in * max(scale, 1)
assert res_height <= height_in * max(scale, 1)

@pytest.fixture()
@pytest.fixture
def small_enough(self):
return 0.07

Expand Down Expand Up @@ -112,7 +112,7 @@ def test_negative_scale(self):


class TestSubplots:
@pytest.fixture()
@pytest.fixture
def _set_size(self, monkeypatch, mocker):
size = mocker.MagicMock()
size.get = mocker.MagicMock(return_value=(400, 300))
Expand Down

0 comments on commit 4be4b5b

Please sign in to comment.