Description: Disable Network tests in short mode
 Some Debian build daemons and autopkgtest nodes have network disabled, as
 no package should be attempting such outbound connections.
Author: Guillem Jover <gjover@sipwise.com>
Origin: other, Sipwise
Forwarded: no
Last-Update: 2024-09-19

---
 doc_test.go |   12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

--- a/doc_test.go
+++ b/doc_test.go
@@ -49,9 +49,13 @@ func ExampleSpec() {
 	// Output: This spec is valid
 }
 
-func ExampleSpec_second() {
+func ExampleSpec_second(t *testing.T) {
 	// Example with high level spec validation call, without showing warnings
 
+	if testing.Short() {
+		t.Skip("Skipping network test in short mode")
+	}
+
 	// Example with online spec URL:
 	url := "http://petstore.swagger.io/v2/swagger.json"
 	doc, err := loads.JSONSpec(url)
@@ -100,9 +104,13 @@ func ExampleSpecValidator_Validate() {
 	// This spec has some validation warnings
 }
 
-func ExampleSpecValidator_Validate_url() {
+func ExampleSpecValidator_Validate_url(t *testing.T) {
 	// Example of spec validation call with full result
 
+	if testing.Short() {
+		t.Skip("Skipping network test in short mode")
+	}
+
 	// Example with online spec URL:
 	url := "http://petstore.swagger.io/v2/swagger.json"
 	doc, err := loads.JSONSpec(url)
