From 1bd53697b99b728515adb36e06b2358d013e7593 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Michael=20Elsd=C3=B6rfer?= Date: Tue, 30 Aug 2016 17:47:09 +0200 Subject: [PATCH] Fix the CLI test inside pytest runner. --- test/test_cli.py | 19 +++++++------------ 1 file changed, 7 insertions(+), 12 deletions(-) diff --git a/test/test_cli.py b/test/test_cli.py index b9aebc3..14df358 100644 --- a/test/test_cli.py +++ b/test/test_cli.py @@ -34,27 +34,22 @@ class TestCLI(): """ Contains setups, teardowns, and tests for CLI """ - def __init__(self): - """ Initalize the tests. - 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(): + @classmethod + def setup_class(cls): """ Create a config file to read from """ with open(CONFIGFILE, 'w') as config: config.write(CONFIG_YAML) - @staticmethod - def teardown_class(): + @classmethod + def teardown_class(cls): """ Remove config file """ os.remove(CONFIGFILE) def setup(self): """ Create a file to print to and set up env""" + self.env = None + self.default_args = None + self.env = TestFileEnvironment( base_path=TEST_DIR, cwd=os.getcwd(),