You could use skipTest from the setUp method in your specific TestCase, like:
import os
from unittest import TestCase
class MyTest(TestCase):
def setUp(self):
if not os.path.exists('configfile'):
return self.skipTest('config file not found')
def test01(self):
# Do something with the file
with open('configfile') as fd:
self.assertEqual(fd.readlines().__len__(), 0)
test test01 would not run if config file does not exist.