Fixes unit tests on Windows.

An exception is being thrown when tests are skipped if
the class name starts with Test causing the suite to
fail. Changing the  name to .*Test fixes the problem.

Closes-Bug: #1609782
Change-Id: I8ef761a53737d82f1cf6288a655d014c98407e1c
This commit is contained in:
Bogdan Teleaga 2016-08-02 18:49:29 +02:00
parent 108b2016a9
commit 4982b93c4e
2 changed files with 5 additions and 5 deletions

View File

@ -63,7 +63,7 @@ class LogTest(testctx.TestContextTestCase):
@testtools.skipIf(platform.system() != 'Linux',
'works only on Linux platform.')
class TestDaemon(base.BaseTestCase):
class DaemonTest(base.BaseTestCase):
@mock.patch('os.setuid')
@mock.patch('os.setgid')
@ -98,7 +98,7 @@ class TestDaemon(base.BaseTestCase):
@testtools.skipIf(platform.system() != 'Linux',
'works only on Linux platform.')
class TestWithContext(testctx.TestContextTestCase):
class WithContextTest(testctx.TestContextTestCase):
def test_unexported(self):
self.assertRaisesRegexp(

View File

@ -59,7 +59,7 @@ def fail(custom=False):
@testtools.skipIf(platform.system() != 'Linux',
'works only on Linux platform.')
class TestPrivContext(testctx.TestContextTestCase):
class PrivContextTest(testctx.TestContextTestCase):
@mock.patch.object(priv_context, 'sys')
def test_init_windows(self, mock_sys):
@ -126,7 +126,7 @@ class TestPrivContext(testctx.TestContextTestCase):
@testtools.skipIf(platform.system() != 'Linux',
'works only on Linux platform.')
class TestSeparation(testctx.TestContextTestCase):
class SeparationTest(testctx.TestContextTestCase):
def test_getpid(self):
# Verify that priv_getpid() was executed in another process.
priv_pid = priv_getpid()
@ -177,7 +177,7 @@ class RootwrapTest(testctx.TestContextTestCase):
@testtools.skipIf(platform.system() != 'Linux',
'works only on Linux platform.')
class TestSerialization(testctx.TestContextTestCase):
class SerializationTest(testctx.TestContextTestCase):
def test_basic_functionality(self):
self.assertEqual(43, add1(42))