Skip to content
This repository was archived by the owner on Mar 10, 2026. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 22 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,30 @@ jobs:

- name: Install Python
run: uv python install

- name: Install python dependencies
run: uv sync --locked --dev

- name: Run pre-commit hooks
run: uv run prek

tests:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- name: Checkout repository
uses: actions/checkout@v6

- name: Install uv
uses: astral-sh/setup-uv@v7
with:
enable-cache: true

- name: Install Python
run: uv python install

- name: Install python dependencies
run: uv sync --locked --dev

- name: Run tests
run: uv run pytest -m "not network"
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
uv sync --dev
```

6. Install pre-commit hook:
6. Install pre-commit hooks:

```sh
uv run prek install
Expand Down
5 changes: 5 additions & 0 deletions pytest.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[pytest]
addopts = ["--strict-markers"]
Comment on lines +1 to +2

Copilot AI Jan 27, 2026

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pytest.toml is not a standard pytest auto-discovered config filename in many setups; since the repo doesn’t invoke pytest with -c pytest.toml, --strict-markers and the network marker registration may not be applied. To ensure this works consistently, move these settings into pyproject.toml under [tool.pytest.ini_options] (or use pytest.ini), and keep addopts in the format pytest expects for that config source (often a single string).

Suggested change
[pytest]
addopts = ["--strict-markers"]
[tool.pytest.ini_options]
addopts = "--strict-markers"

Copilot uses AI. Check for mistakes.
markers = [
"network: network tests that require internet access and could be slow",
]
9 changes: 8 additions & 1 deletion tests/core/test_network.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,14 @@

import json

import pytest

import mdverse_scrapers.core.network as network
import mdverse_scrapers.core.toolbox as toolbox
from mdverse_scrapers.core.logger import create_logger


@pytest.mark.network
def test_make_http_get_request_with_retries_200():
"""Test the make_http_get_request_with_retries function."""
url = "https://httpbin.org/get"
Expand All @@ -20,6 +23,7 @@ def test_make_http_get_request_with_retries_200():
assert response.status_code == 200


@pytest.mark.network
def test_make_http_get_request_with_retries_202():
"""Test the make_http_get_request_with_retries function."""
url = "https://httpbin.org/status/202"
Expand All @@ -32,6 +36,7 @@ def test_make_http_get_request_with_retries_202():
assert response is None


@pytest.mark.network
def test_make_http_get_request_with_retries_404():
"""Test the make_http_get_request_with_retries function."""
url = "https://httpbin.org/status/404"
Expand All @@ -44,8 +49,9 @@ def test_make_http_get_request_with_retries_404():
assert response is None


@pytest.mark.network
def test_get_html_page_with_selenium_good_url():
"""Test the get_html_page_with_selenium function with a bad URL."""
"""Test the get_html_page_with_selenium function with a good URL."""
url = "https://figshare.com/ndownloader/files/21988230/preview/21988230/structure.json"
expected_json = {
"files": [],
Expand All @@ -67,6 +73,7 @@ def test_get_html_page_with_selenium_good_url():
assert json.loads(content) == expected_json


@pytest.mark.network
def test_get_html_page_with_selenium_bad_url(capsys) -> None:
"""Test the get_html_page_with_selenium function with a bad URL."""
url = "https://figshare.com/ndownloader/files/28089615/preview/28089615/structure.json"
Expand Down