Skip to content

Commit

Permalink
use conftest for fixtures, fixing all flake8 warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
ModischFabrications committed Apr 10, 2024
1 parent 143f34d commit 06cdf82
Show file tree
Hide file tree
Showing 6 changed files with 4 additions and 5 deletions.
2 changes: 2 additions & 0 deletions tests/test_fixtures.py → tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
from app.solver.data.Result import Result


# conftest.py is a magic pytest file for fixtures that is imported automatically

def load_json(json_path: Path):
assert json_path.exists()

Expand Down
1 change: 0 additions & 1 deletion tests/solver/data/test_Job.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from app.solver.data.Job import Job, INS, NS
from app.solver.data.Job import QNS
from tests.test_fixtures import testjob_s


def test_constructor():
Expand Down
1 change: 0 additions & 1 deletion tests/solver/data/test_Result.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

from app.solver.data.Job import NS
from app.solver.data.Result import Result, SolverType, ResultEntry
from tests.test_fixtures import testjob_s


def test_constructor(testjob_s):
Expand Down
2 changes: 1 addition & 1 deletion tests/solver/test_multi.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from app.solver.data.Job import Job, QNS, INS, NS
from app.solver.data.Result import Result, ResultEntry
from app.solver.solver import _solve_bruteforce, _solve_FFD, _solve_gapfill
from tests.test_fixtures import load_json
from tests.conftest import load_json


def test_job_from_json():
Expand Down
2 changes: 1 addition & 1 deletion tests/solver/test_solver.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
_solve_gapfill,
_solve_FFD, solve,
)
from tests.test_fixtures import load_json, testjob_s
from tests.conftest import load_json


@pytest.mark.parametrize("solver", [_solve_bruteforce, _solve_FFD, _solve_gapfill])
Expand Down
1 change: 0 additions & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@

from app.main import app
from app.solver.data.Result import Result
from tests.test_fixtures import testjob_s, testresult_s

client: TestClient = TestClient(app)

Expand Down

0 comments on commit 06cdf82

Please sign in to comment.