Skip to content

Commit

Permalink
Fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
atollk committed Jul 14, 2023
1 parent 55f3d34 commit b80d16a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions requirements/py310.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flake8>=5,<6
pytest-flake8dir>=2.2,<3
pytest>=5.4,<6
pytest-flake8-path>=1.5.0,<2
pytest>=7,<8
4 changes: 2 additions & 2 deletions requirements/py311.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flake8>=5,<6
pytest-flake8dir>=2.2,<3
pytest>=5.4,<6
pytest-flake8-path>=1.5.0,<2
pytest>=7,<8
4 changes: 2 additions & 2 deletions requirements/py38.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flake8>=5,<6
pytest-flake8dir>=2.2,<3
pytest>=5.4,<6
pytest-flake8-path>=1.5.0,<2
pytest>=7,<8
4 changes: 2 additions & 2 deletions requirements/py39.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
flake8>=5,<6
pytest-flake8dir>=2.2,<3
pytest>=5.4,<6
pytest-flake8-path>=1.5.0,<2
pytest>=7,<8
12 changes: 7 additions & 5 deletions tests/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,15 @@ def error_code(self) -> str:
raise NotImplementedError

@pytest.fixture(autouse=True)
def _flake8dir(self, flake8dir):
self.flake8dir = flake8dir
def _flake8dir(self, flake8_path):
self.flake8_path = flake8_path

def run_flake8(self, code: str) -> List[ReportedMessage]:
self.flake8dir.make_example_py(textwrap.dedent(code))
def run_flake8(
self, code: str
) -> List[ReportedMessage]:
(self.flake8_path / "example.py").write_text(textwrap.dedent(code))
args = [f"--select_csm1={self.error_code()}"]
result = self.flake8dir.run_flake8(args)
result = self.flake8_path.run_flake8(args)
return [ReportedMessage.from_raw(report) for report in result.out_lines]

def assert_error_at(
Expand Down

0 comments on commit b80d16a

Please sign in to comment.