1. Jason Pellerin
  2. nose2

Commits

jpellerin  committed 41bfd50

Updated to use _common.TestCase

  • Participants
  • Parent commits 8a9f736
  • Branches default

Comments (0)

Files changed (1)

File nose2/tests/test_testid_plugin.py

View file
 """Test testid plugin."""
-from unittest2 import TestCase
 import re
 import os.path
 import pickle
 
 from ..plugins import testid
 from ._common import (FakeStartTestEvent, FakeLoadFromNameEvent,
-                      FakeLoadFromNamesEvent)
+                      FakeLoadFromNamesEvent, TestCase)
 
 class UnitTestTestId(TestCase):
     """Test class TestId.
     to file. The temporary directory is removed after testing.
     """
     tags = ['unit']
-
-    def setUp(self):
-        super(UnitTestTestId, self).setUp()
-        self._orig_dir = os.getcwd()
-        # XXX: Use deterministic temporary directory, which can be inspected
-        # after test?
-        self._temp_dir = tempfile.mkdtemp()
-        os.chdir(self._temp_dir)
-
-    def tearDown(self):
-        super(UnitTestTestId, self).tearDown()
-        os.chdir(self._orig_dir)
-        shutil.rmtree(self._temp_dir, ignore_errors=True)
+    _RUN_IN_TEMP = True
 
     def test___init__(self):
         """Test the __init__ method."""