diff --git a/.circleci/config.yml b/.circleci/config.yml index 9391364..e7c4ba1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -39,12 +39,12 @@ jobs: pip install pyumldiagrams==3.1.0 pip install codeallybasic==0.5.2 pip install codeallyadvanced==0.5.2 - pip install pyutmodel==1.5.0 - pip install ogl==0.90.3 - pip install untanglepyut==1.3.1 - pip install oglio==1.2.1 - pip install buildlackey~=1.5.0 + pip install pyutmodel==1.5.1 + pip install ogl==1.0.0 + pip install untanglepyut==1.3.2 + pip install oglio==1.2.2 + pip install buildlackey~=1.6.0 - run: name: run tests command: | - runtests \ No newline at end of file + unittests -s . \ No newline at end of file diff --git a/pyutplugins/_version.py b/pyutplugins/_version.py index 16a55cf..feda315 100644 --- a/pyutplugins/_version.py +++ b/pyutplugins/_version.py @@ -1 +1 @@ -__version__: str = '1.2.1' +__version__: str = '1.2.2' diff --git a/requirements.txt b/requirements.txt index bcb881f..81ebe83 100644 --- a/requirements.txt +++ b/requirements.txt @@ -4,10 +4,10 @@ twine==4.0.2 build==1.0.3 html-testRunner~=1.2.1 -mypy==1.7.0 +mypy==1.7.1 mypy-extensions==1.0.0 types-Deprecated==1.2.9.3 -types-setuptools==68.2.0.1 +types-setuptools==68.2.0.2 typing_extensions==4.8.0 # For IOPython @@ -21,12 +21,12 @@ wxPython==4.2.1 codeallybasic==0.5.2 codeallyadvanced==0.5.2 -pyutmodel==1.5.0 -ogl==0.90.3 -untanglepyut==1.3.1 -oglio==1.2.1 +pyutmodel==1.5.1 +ogl==1.0.0 +untanglepyut==1.3.2 +oglio==1.2.2 -buildlackey==1.5.0 +buildlackey==1.6.0 # Pin networkx to match orthgonal networkx==3.0 diff --git a/setup.py b/setup.py index c8cd9b6..362781b 100644 --- a/setup.py +++ b/setup.py @@ -54,7 +54,7 @@ 'pyutplugins.preferences', 'pyutplugins.toolplugins', 'pyutplugins.toolplugins.orthogonal', 'pyutplugins.toolplugins.sugiyama', ], - install_requires=['pyutmodel==1.5.0', 'ogl==0.90.3', 'untanglepyut==1.3.1', 'oglio==1.2.1', 'codeallybasic~=0.5.2', 'codeallyadvanced~=0.5.2', 'pyumldiagrams==3.1.0', + install_requires=['pyutmodel==1.5.1', 'ogl==1.0.0', 'untanglepyut==1.3.2', 'oglio==1.2.2', 'codeallybasic~=0.5.2', 'codeallyadvanced~=0.5.2', 'pyumldiagrams==3.1.0', 'wxPython~=4.2.1', 'antlr4-python3-runtime==4.11.1', 'networkx==3.0', diff --git a/tests/TestAll.py b/tests/TestAll.py deleted file mode 100644 index 904cb46..0000000 --- a/tests/TestAll.py +++ /dev/null @@ -1,170 +0,0 @@ - -from typing import List - -from logging import Logger -from logging import getLogger - -from sys import path as sysPath -from sys import argv as sysArgv - -from importlib import import_module - -from os import walk as osWalk -from os import sep as osSep - -from re import search as regExSearch - -from unittest import TestResult -from unittest import TextTestRunner -from unittest.suite import TestSuite - -from HtmlTestRunner import HTMLTestRunner - - -class TestAll: - """ - The class that can run our unit tests in various formats - """ - NOT_TESTS: List[str] = ['TestAll', 'TestBase', - 'TestTemplate', - 'AppTestDialogs', - 'pyutplugins/plugininterfaces/TestSamplePluginInterface'] - - VERBOSITY_QUIET: int = 0 # Print the total numbers of tests executed and the global result - VERBOSITY_DEFAULT: int = 1 # VERBOSITY_QUIET plus a dot for every successful test or an F for every failure - VERBOSITY_VERBOSE: int = 2 # Print help string of every test and the result - VERBOSITY_LOUD: int = 3 # ?? - - def __init__(self): - - self._setupSystemLogging() - - self.logger: Logger = getLogger(__name__) - - self._testSuite: TestSuite = self._getTestSuite() - - def runTextTestRunner(self) -> int: - - runner: TextTestRunner = TextTestRunner(verbosity=TestAll.VERBOSITY_DEFAULT) - status: TestResult = runner.run(self._testSuite) - print(f"THE RESULTS ARE IN:") - print(f"run: {status.testsRun} errors: {len(status.errors)} failures: {len(status.failures)} skipped: {len(status.skipped)}") - if len(status.failures) != 0: - return 1 - else: - return 0 - - def runHtmlTestRunner(self) -> int: - - runner = HTMLTestRunner(report_name='PyutTestResults', combine_reports=True, add_timestamp=True) - status = runner.run(self._testSuite) - if len(status.failures) != 0: - return 1 - else: - return 0 - - def _setupSystemLogging(self): - """ - Read the unit test logging configuration file - """ - from tests.TestBase import TestBase - - TestBase.setUpLogging() - - def _getTestSuite(self) -> TestSuite: - """ - - Returns: - A suite of all tests in the unit test directory - """ - modules: List[str] = self.__getTestableModuleNames() - fSuite: TestSuite = TestSuite() - for module in modules: - try: - fixedName: str = module.replace('/', '.') - m = import_module(fixedName) - # noinspection PyUnresolvedReferences - fSuite.addTest(m.suite()) - except (ValueError, Exception) as e: - self.logger.error(f'Module import problem with: {module}: {e}') - return fSuite - - def __getTestableModuleNames(self) -> List[str]: - """ - Removes modules that are not unit tests - - Returns: - A list of testable module names - """ - - allModules: List[str] = self.__getModuleNames() - - self.logger.debug(f'{allModules=}') - - for doNotTest in TestAll.NOT_TESTS: - try: - allModules.remove(f'tests/{doNotTest}') - except ValueError as ve: - self.logger.error(f'Missing non-test. {ve} did you forget to update "NOT_TESTS" with "{doNotTest}"') - raise ve - - return allModules - - def __getModuleNames(self) -> List[str]: - """ - Get all likely test modules - - Returns: - A list of module names that we can find in this package - """ - testFilenames: List[str] = [] - rootDir = 'tests' - for dirName, subdirList, fileList in osWalk(rootDir): - if '__pycache__' in dirName: - continue - self.logger.debug(f'directory: {dirName}') - for fName in fileList: - if self.__startsWith('Test', fName) is True: - fqFileName: str = f'{dirName}{osSep}{fName}' - self.logger.debug(f'{fqFileName}') - testFilenames.append(fqFileName) - - # remove .py extension - modules = list(map(lambda x: x[:-3], testFilenames)) - - return modules - - def __startsWith(self, pattern: str, stringToCheck: str) -> bool: - - ans: bool = False - if pattern in stringToCheck: - # passes first easy test - regExp: str = f'^{pattern}' - match = regExSearch(regExp, stringToCheck) - if match: - ans = True - - return ans - - -def main(): - - if ".." not in sysPath: - sysPath.append("..") # access to the classes to test - - testAll: TestAll = TestAll() - status: int = 0 - if len(sysArgv) < 2: - status = testAll.runTextTestRunner() - else: - for param in sysArgv[1:]: - if param[:22] == "--produce-html-results": - print(f'Running HTML Tests') - status = testAll.runHtmlTestRunner() - - return status - - -if __name__ == "__main__": - cliStatus: int = main() - exit(cliStatus)