Skip to content

feat: add network marker to tests requiring network access - #2337

Closed
mcepl wants to merge 1 commit into
gitpython-developers:mainfrom
openSUSE-Python:no-network
Closed

mcepl wants to merge 1 commit into
gitpython-developers:mainfrom
openSUSE-Python:no-network

Conversation

@mcepl

@mcepl mcepl commented Nov 3, 2026

Copy link
Copy Markdown

Sometimes it’s useful to have the tests that use the network marked so they can be skipped easily when we know the network is not available.

This is useful for example on SUSE and openSUSE’s build servers. When building our packages the network is disabled so we can assure reproducible builds (among other benefits). With this mark, it’s easier to skip tests that can not succeed.

Copilot AI balanced review requested due to automatic review settings November 3, 2026 23:47

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 Changes recommended

The net marker leaves socket-dependent tests and a daemon-launching parameter unmarked, so pytest -m 'not net' still attempts network access on socket-restricted builders.

1 open issue
What changed in this PR

GitHub Copilot: This PR adds a pytest net marker so builders with networking disabled can exclude marked tests using pytest -m 'not net'.

Changes:

  • Registers net as a supported pytest marker.
  • Marks three tests that use the remote-repository daemon helper.
File Description
test/​test_remote.py Marks two remote-operation tests as network-dependent.
test/​test_base.py Imports pytest and marks the remote-repository helper test.
pyproject.toml Registers and describes the net marker.

Review effort: Balanced

Comment thread pyproject.toml Resolved
@Byron

Byron commented Nov 4, 2026

Copy link
Copy Markdown
Member

Sure, why not.

It's a bit strange that GitPython needs external network access, and I am looking into this.
From what I can tell right now, plenty of annotations are missing, so it's strange this subset works for you. Maybe there is more about it.

Will have to supersede the PR as I can't push into it.

@Byron Byron mentioned this pull request Nov 4, 2026
@Byron

Byron commented Nov 4, 2026

Copy link
Copy Markdown
Member

Superseded by #2338 (which includes this commit)

@Byron Byron closed this Nov 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants