Skip to content

Commit

Permalink
Allow later numpy versions (#124)
Browse files Browse the repository at this point in the history
* Allow later numpy versions

* Use tmp_path for download tests so the root dir isn't polluted
N-Wouda authored Oct 14, 2024
1 parent 04ce196 commit 74d4b6d
Showing 4 changed files with 341 additions and 311 deletions.
630 changes: 331 additions & 299 deletions poetry.lock

Large diffs are not rendered by default.

6 changes: 2 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -9,17 +9,14 @@ repository = "https://github.com/PyVRP/VRPLIB"

[tool.poetry.dependencies]
python = "^3.9"
numpy = "^1.19.3"
numpy = ">=1.19.3"

[tool.poetry.group.dev.dependencies]
pytest = "^7.1.2"
codecov = "^2.1.13"
pytest-cov = "^4.0.0"
pre-commit = "^2.19.0"

[pytest]
pythonpath = [".", "vrplib"]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
@@ -48,6 +45,7 @@ ignore = [

[tool.pytest.ini_options]
addopts = "--cov=. --cov-report=xml"
pythonpath = [".", "vrplib"]

[tool.coverage.run]
omit = [
8 changes: 4 additions & 4 deletions tests/download/test_download_instance.py
Original file line number Diff line number Diff line change
@@ -6,21 +6,21 @@
from vrplib import download_instance


def test_deprecation_warning():
def test_deprecation_warning(tmp_path):
"""
Checks if a deprecation warning is raised when the function is called.
"""
with pytest.warns(DeprecationWarning):
download_instance("X-n101-k25", "tmp")
download_instance("X-n101-k25", tmp_path / "tmp")


@pytest.mark.filterwarnings("ignore:The function")
def test_raise_invalid_name():
def test_raise_invalid_name(tmp_path):
"""
Raise an error if the passed-in name is invalid.
"""
with pytest.raises(ValueError):
download_instance("invalid_name", "tmp")
download_instance("invalid_name", tmp_path / "tmp")


@pytest.mark.filterwarnings("ignore:The function")
8 changes: 4 additions & 4 deletions tests/download/test_download_solution.py
Original file line number Diff line number Diff line change
@@ -6,21 +6,21 @@
from vrplib import download_solution


def test_deprecation_warning():
def test_deprecation_warning(tmp_path):
"""
Checks if a deprecation warning is raised when the function is called.
"""
with pytest.warns(DeprecationWarning):
download_solution("X-n101-k25", "tmp")
download_solution("X-n101-k25", tmp_path / "tmp")


@pytest.mark.filterwarnings("ignore:The function")
def test_raise_invalid_name():
def test_raise_invalid_name(tmp_path):
"""
Raise an error if the passed-in name is invalid.
"""
with assert_raises(ValueError):
download_solution("invalid_name", "tmp")
download_solution("invalid_name", tmp_path / "tmp")


@pytest.mark.filterwarnings("ignore:The function")

0 comments on commit 74d4b6d

Please sign in to comment.