Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5da0924

Browse files
author
Siddharta Govindaraj
committed
Conditionally skipping tests
1 parent a5b2011 commit 5da0924

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stock_alerter/tests/test_stock.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
import sys
12
import unittest
23
import collections
34
from datetime import datetime, timedelta
@@ -12,7 +13,7 @@ def setUp(self):
1213
def test_price_of_a_new_stock_class_should_be_None(self):
1314
self.assertIsNone(self.goog.price)
1415

15-
@unittest.skip("skip this test for now")
16+
@unittest.skipIf(sys.platform.startswith("win"), "skip on windows")
1617
def test_stock_update(self):
1718
"""An update should set the price on the stock object
1819
@@ -21,6 +22,7 @@ def test_stock_update(self):
2122
self.goog.update(datetime(2014, 2, 12), price=10)
2223
self.assertEqual(10, self.goog.price)
2324

25+
@unittest.skipUnless(sys.platform.startswith("win"), "only run on windows")
2426
def test_negative_price_should_throw_ValueError(self):
2527
with self.assertRaises(ValueError):
2628
self.goog.update(datetime(2014, 2, 13), -1)

0 commit comments

Comments
 (0)