From 6ac20bc4f617c85cfd565630a5f79da2a78fe2cd Mon Sep 17 00:00:00 2001 From: Andrew Senetar Date: Thu, 11 Jun 2020 23:20:16 -0500 Subject: [PATCH] Fix new issues with unit tests - Create custom test suite based on platform - Use the custom suite for all tests - Update tox.ini to install pywin32 --- tests/__init__.py | 18 ++++++++++++++++++ tox.ini | 10 ++++++++-- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/tests/__init__.py b/tests/__init__.py index e69de29..4cb17e9 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -0,0 +1,18 @@ +import sys +import unittest + + +def TestSuite(): + suite = unittest.TestSuite() + loader = unittest.TestLoader() + if sys.platform == "win32": + from . import test_plat_win + + suite.addTests(loader.loadTestsFromModule(test_plat_win)) + else: + from . import test_script_main + from . import test_plat_other + + suite.addTests(loader.loadTestsFromModule(test_script_main)) + suite.addTests(loader.loadTestsFromModule(test_plat_other)) + return suite diff --git a/tox.ini b/tox.ini index 2e76858..c23aca0 100644 --- a/tox.ini +++ b/tox.ini @@ -5,13 +5,19 @@ skip_missing_interpreters = True [testenv] platform = linux commands = - python setup.py test + python setup.py test --test-suite tests.TestSuite [testenv:py3-win] platform = win commands = - python setup.py test --test-suite tests.test_plat_win + python pip install pywin32 + python setup.py test --test-suite tests.TestSuite [testenv:py27] deps = configparser + +[flake8] +exclude = .tox,env,build +max-line-length = 120 +ignore = E731,E203,E501,W503 \ No newline at end of file