Skip to content
This repository was archived by the owner on Mar 4, 2026. It is now read-only.

Commit 65c1858

Browse files
committed
Skip integration tests if missing envvar
Similar to how tests are handled in packngo and terraform-provider-packet.
1 parent 6db5f1c commit 65c1858

10 files changed

Lines changed: 40 additions & 0 deletions

test/test_batch.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from datetime import datetime
1111

1212

13+
@unittest.skipIf(
14+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
15+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
16+
)
1317
class TestBatches(unittest.TestCase):
1418
@classmethod
1519
def setUpClass(self):

test/test_device.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from datetime import datetime
1111

1212

13+
@unittest.skipIf(
14+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
15+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
16+
)
1317
class TestDevice(unittest.TestCase):
1418
@classmethod
1519
def setUpClass(self):

test/test_email.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@
88
import random
99

1010

11+
@unittest.skipIf(
12+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
13+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
14+
)
1115
class TestEmail(unittest.TestCase):
1216
@classmethod
1317
def setUpClass(cls):

test/test_event.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
from datetime import datetime
1010

1111

12+
@unittest.skipIf(
13+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
14+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
15+
)
1216
class TestEvent(unittest.TestCase):
1317
@classmethod
1418
def setUpClass(cls):

test/test_ips.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from datetime import datetime
1111

1212

13+
@unittest.skipIf(
14+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
15+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
16+
)
1317
class TestIps(unittest.TestCase):
1418
@classmethod
1519
def setUpClass(cls):

test/test_organization.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,10 @@
77
import packet
88

99

10+
@unittest.skipIf(
11+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
12+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
13+
)
1014
class TestOrganization(unittest.TestCase):
1115
@classmethod
1216
def setUpClass(self):

test/test_ports.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from datetime import datetime
1111

1212

13+
@unittest.skipIf(
14+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
15+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
16+
)
1317
class TestPorts(unittest.TestCase):
1418
@classmethod
1519
def setUpClass(self):

test/test_vlan.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from datetime import datetime
1111

1212

13+
@unittest.skipIf(
14+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
15+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
16+
)
1317
class TestVlan(unittest.TestCase):
1418
@classmethod
1519
def setUpClass(self):

test/test_volume.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,10 @@
1010
from datetime import datetime
1111

1212

13+
@unittest.skipIf(
14+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
15+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
16+
)
1317
class TestVolume(unittest.TestCase):
1418
@classmethod
1519
def setUpClass(self):

test/test_vpn.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,10 @@
99
import packet
1010

1111

12+
@unittest.skipIf(
13+
"PACKET_PYTHON_TEST_ACTUAL_API" not in os.environ,
14+
"PACKET_PYTHON_TEST_ACTUAL_API is missing from environment",
15+
)
1216
class TestVpn(unittest.TestCase):
1317
@classmethod
1418
def setUpClass(self):

0 commit comments

Comments
 (0)