Skip to content

Commit

Permalink
Merge pull request #198 from EJEP/use_flake8_pytest_style
Browse files Browse the repository at this point in the history
Use flake8-pytest-style plugin in auto-linters
  • Loading branch information
Emily Price authored Nov 26, 2024
2 parents e559ef8 + 9cda60b commit 23f254d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/lint.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,5 +41,5 @@ jobs:
python-version: "3.12"
- name: Install and run linter
run: |
pip install flake8==7.1.0 flake8-bugbear
pip install flake8==7.1.0 flake8-bugbear flake8-pytest-style
flake8
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ repos:
- id: flake8
additional_dependencies:
- flake8-bugbear==24.2.6
- flake8-pytest-style==2.0.0
- repo: https://github.com/psf/black
rev: 22.10.0
hooks:
Expand Down
2 changes: 1 addition & 1 deletion requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,6 @@ black==24.*
isort==5.*
flake8==7.*
flake8-bugbear==24.*
flake8-pytest-style==1.*
flake8-pytest-style==2.*
pytest==8.*
.
12 changes: 6 additions & 6 deletions tests/integration/test_manager.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ def raise_for_status():


@pytest.fixture
def mock_response_hourly(monkeypatch):
def _mock_response_hourly(monkeypatch):
def mock_get(*args, **kwargs):
return MockResponseHourly()

monkeypatch.setattr(requests.Session, "get", mock_get)


@pytest.fixture
def hourly_forecast(mock_response_hourly):
def hourly_forecast(_mock_response_hourly):
m = Manager(api_key="aaaaaaaaaaaaaaaaaaaaaaaaa")
f = m.get_forecast(50.9992, 0.0154, frequency="hourly", convert_weather_code=True)
return f
Expand All @@ -50,15 +50,15 @@ def raise_for_status():


@pytest.fixture
def mock_response_three_hourly(monkeypatch):
def _mock_response_three_hourly(monkeypatch):
def mock_get(*args, **kwargs):
return MockResponseThreeHourly()

monkeypatch.setattr(requests.Session, "get", mock_get)


@pytest.fixture
def three_hourly_forecast(mock_response_three_hourly):
def three_hourly_forecast(_mock_response_three_hourly):
m = Manager(api_key="aaaaaaaaaaaaaaaaaaaaaaaaa")
f = m.get_forecast(
50.9992, 0.0154, frequency="three-hourly", convert_weather_code=True
Expand All @@ -84,15 +84,15 @@ def raise_for_status():


@pytest.fixture
def mock_response_daily(monkeypatch):
def _mock_response_daily(monkeypatch):
def mock_get(*args, **kwargs):
return MockResponseDaily()

monkeypatch.setattr(requests.Session, "get", mock_get)


@pytest.fixture
def daily_forecast(mock_response_daily):
def daily_forecast(_mock_response_daily):
m = Manager(api_key="aaaaaaaaaaaaaaaaaaaaaaaaa")
f = m.get_forecast(50.9992, 0.0154, frequency="daily", convert_weather_code=True)
return f
Expand Down

0 comments on commit 23f254d

Please sign in to comment.