Fix the CLI test inside pytest runner.

This commit is contained in:
Michael Elsdörfer 2016-08-30 17:47:09 +02:00
parent 58ea206c36
commit 1bd53697b9
1 changed files with 7 additions and 12 deletions

View File

@ -34,27 +34,22 @@ class TestCLI():
""" Contains setups, teardowns, and tests for CLI """ Contains setups, teardowns, and tests for CLI
""" """
def __init__(self): @classmethod
""" Initalize the tests. def setup_class(cls):
Just define some vars here since most of them get set during
setup_class and teardown_class
"""
self.env = None
self.default_args = None
@staticmethod
def setup_class():
""" Create a config file to read from """ """ Create a config file to read from """
with open(CONFIGFILE, 'w') as config: with open(CONFIGFILE, 'w') as config:
config.write(CONFIG_YAML) config.write(CONFIG_YAML)
@staticmethod @classmethod
def teardown_class(): def teardown_class(cls):
""" Remove config file """ """ Remove config file """
os.remove(CONFIGFILE) os.remove(CONFIGFILE)
def setup(self): def setup(self):
""" Create a file to print to and set up env""" """ Create a file to print to and set up env"""
self.env = None
self.default_args = None
self.env = TestFileEnvironment( self.env = TestFileEnvironment(
base_path=TEST_DIR, base_path=TEST_DIR,
cwd=os.getcwd(), cwd=os.getcwd(),