-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Honor 'network' marker to signal network-dependent tests. Fixes #5.
- Loading branch information
Showing
3 changed files
with
33 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,18 @@ | ||
import urllib.request | ||
|
||
import pytest | ||
|
||
|
||
def test_needs_internet(needs_internet): | ||
""" | ||
This test should always succeed or be skipped. | ||
""" | ||
urllib.request.urlopen('http://pypi.org/') | ||
|
||
|
||
@pytest.mark.network | ||
def test_network_marker(): | ||
""" | ||
This test should always succeed or be skipped. | ||
""" | ||
urllib.request.urlopen('http://pypi.org/') |
fbbad0e
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you for this! I dare say it is a great thing — it works out of the box for "unaware" builds, and lets us cleanly block Internet access entirely via
-m "not network"
.