Commits

Anonymous committed d942432

Proper test skip when nose uninstalled and running tests with trial.

Comments (0)

Files changed (3)

tests/test_parser.py

 
 # Proper SkipTest depends on whether we run under trial, or under nose. Let's hack it
 import sys
-from nose import SkipTest as NoseSkipTest
-from twisted.trial.unittest import SkipTest as TrialSkipTest
 if sys.argv[0].endswith("trial"):
+    from twisted.trial.unittest import SkipTest as TrialSkipTest
     SkipTest = TrialSkipTest
 else:
+    from nose import SkipTest as NoseSkipTest
     SkipTest = NoseSkipTest
 
 FICS_PARSE_DATA_DIR = "ficsparserdata"

tests/test_playerName.py

 # -*- coding: utf-8 -*-
 from unittest import TestCase
-from nose import SkipTest
+import sys
+if sys.argv[0].endswith("trial"):
+    from twisted.trial.unittest import SkipTest as TrialSkipTest
+    SkipTest = TrialSkipTest
+else:
+    from nose import SkipTest as NoseSkipTest
+    SkipTest = NoseSkipTest
 from mekk.fics.datatypes.player import PlayerName
 
 class TestPlayerName(TestCase):
         self.failUnlessEqual( d[PlayerName("belaj")], 7 )
     def test_comparable_with_string(self):
         self.failUnlessEqual(PlayerName("Mekk"), "mekk")
-        self.failIfEqual(PlayerName("Mekk"), "mek")
+        self.failIfEqual(PlayerName("Mekk"), "mek")

tests/test_style12.py

         self.failUnlessEqual(s12.last_ply_no, 3)
         self.failUnlessEqual(s12.last_move_time_spent, 3748)
 
-# TODO: remove all "raise SkipTest" (and implement things needed to make those tests work)