Skip to content

Commit 3162a34

Browse files
Merge pull request #404 from watson-developer-cloud/integration-tests
Add pytest skipif if env file not found
2 parents 56357f1 + 133fe0f commit 3162a34

4 files changed

Lines changed: 12 additions & 5 deletions

File tree

test/integration/test_discovery_v1.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,10 @@
33
import os
44
import watson_developer_cloud
55
import random
6+
import pytest
67

7-
8+
@pytest.mark.skipif(
9+
os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
810
class Discoveryv1(TestCase):
911
def setUp(self):
1012
self.discovery = watson_developer_cloud.DiscoveryV1(

test/integration/test_speech_to_text_v1.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,11 @@
22
from unittest import TestCase
33
import os
44
import watson_developer_cloud
5+
import pytest
56

67

8+
@pytest.mark.skipif(
9+
os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
710
class TestSpeechToTextV1(TestCase):
811
def setUp(self):
912
self.speech_to_text = watson_developer_cloud.SpeechToTextV1(

test/integration/test_text_to_speech_v1.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
# coding: utf-8
22
import unittest
33
import watson_developer_cloud
4+
import pytest
5+
import os
46

5-
7+
@pytest.mark.skipif(
8+
os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
69
class TestIntegrationTextToSpeechV1(unittest.TestCase):
710
def setUp(self):
811
self.text_to_speech = watson_developer_cloud.TextToSpeechV1(

test/integration/test_visual_recognition.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@
66
from unittest import TestCase
77
import json
88

9-
pytestmark = pytest.mark.skip('Run These Manually, they are destructive')
10-
119

10+
@pytest.mark.skipif(
11+
os.getenv('VCAP_SERVICES') is None, reason='requires VCAP_SERVICES')
1212
class IntegrationTestVisualRecognitionV3(TestCase):
1313
def setUp(self):
1414
self.visual_recognition = watson_developer_cloud.VisualRecognitionV3(
@@ -58,4 +58,3 @@ def test_custom_classifier(self):
5858
assert classifiers is not None
5959

6060
output = self.visual_recognition.delete_classifier(classifier_id)
61-
assert output is not None

0 commit comments

Comments
 (0)