diff --git a/.coveragerc b/.coveragerc index e6e83087..0f489fff 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,5 +1,8 @@ [run] branch = True +omit = + art/__main__.py + art/__init__.py [report] exclude_lines = diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 2e9355bd..ce04cea7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -24,8 +24,6 @@ jobs: python setup.py install python -m art test python -m art test2 - python -m art testcov - python -m art testcov2 - name: Install dev-requirements run: | python -m pip install --upgrade pip @@ -53,7 +51,7 @@ jobs: if: matrix.python-version == 3.8 - name: Codecov run: | - python -m art testcov2 + coverage run -m art test2 codecov if: matrix.python-version == 3.8 && matrix.os == 'ubuntu-latest' - name: Profile diff --git a/CHANGELOG.md b/CHANGELOG.md index 7e57f88b..4f44accd 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,8 @@ and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0. - Test system modified - `Python 3.11` added to `test.yml` - `Conda-Forge` installing section added to `INSTALL.md` +### Removed +- `testcov` and `testcov2` modes ## [5.7] - 2022-07-06 ### Added - 5 new font diff --git a/art/__main__.py b/art/__main__.py index 1468d546..6718948a 100644 --- a/art/__main__.py +++ b/art/__main__.py @@ -1,16 +1,11 @@ # -*- coding: utf-8 -*- """Art main.""" from .art import * -from .art_param import FONT_MAP, ART_ENVIRONMENT_WARNING, FONT_ENVIRONMENT_WARNING, PACKAGE_LOAD_WARNING +from .art_param import FONT_MAP, ART_ENVIRONMENT_WARNING, FONT_ENVIRONMENT_WARNING import sys import doctest import os import zipfile -COVERAGE_INSTALL = True -try: - import coverage -except ImportError: - COVERAGE_INSTALL = False def select_test(test_name="TEST"): @@ -22,27 +17,17 @@ def select_test(test_name="TEST"): :return: None """ error_flag_2 = 0 - if test_name == "TESTCOV" or test_name == "TESTCOV2": - if COVERAGE_INSTALL: - cov = coverage.Coverage() - cov.start() - else: - print(PACKAGE_LOAD_WARNING) error_flag_1 = doctest.testfile( "test.py", optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS | doctest.IGNORE_EXCEPTION_DETAIL, verbose=False)[0] - if test_name == "TESTCOV2" or test_name == "TEST2": + if test_name == "TEST2": error_flag_2 = doctest.testfile( "test2.py", optionflags=doctest.NORMALIZE_WHITESPACE | doctest.ELLIPSIS | doctest.IGNORE_EXCEPTION_DETAIL, verbose=False)[0] error_flag = error_flag_1 + error_flag_2 - if (test_name == "TESTCOV" or test_name == "TESTCOV2") and COVERAGE_INSTALL: - cov.stop() - cov.report() - cov.save() if error_flag == 0: print("\n" + test_name + " Passed") sys.exit(error_flag) @@ -54,14 +39,10 @@ def select_test(test_name="TEST"): if __name__ == "__main__": args = sys.argv if len(args) > 1: - if args[1].upper() == "TESTCOV": - select_test("TESTCOV") - elif args[1].upper() == "TEST": + if args[1].upper() == "TEST": select_test("TEST") elif args[1].upper() == "TEST2": select_test("TEST2") - elif args[1].upper() == "TESTCOV2": - select_test("TESTCOV2") elif args[1].upper() in ["LIST", "ARTS"]: art_list() elif args[1].upper() == "FONTS": diff --git a/art/test.py b/art/test.py index 2174afb0..645ee7d3 100644 --- a/art/test.py +++ b/art/test.py @@ -19,6 +19,46 @@ | '--------------' | '----------------' +>>> tprint("\t\t2","block",sep=2) + + .----------------. +| .--------------. | +| | _____ | | +| | / ___ `. | | +| | |_/___) | | | +| | .'____.' | | +| | / /____ | | +| | |_______| | | +| | | | +| '--------------' | + '----------------' + +>>> tprint("\t\t2","block",sep="\n\n") + + + .----------------. + +| .--------------. | + +| | _____ | | + +| | / ___ `. | | + +| | |_/___) | | | + +| | .'____.' | | + +| | / /____ | | + +| | |_______| | | + +| | | | + +| '--------------' | + + '----------------' + + >>> tprint(" ","block") >>> tprint("123","alpha") @@ -4600,6 +4640,10 @@ Traceback (most recent call last): ... art.art.artError: The 'sep' type must be str. +>>> set_default(decoration=2) +Traceback (most recent call last): + ... +art.art.artError: The 'decoration' type must be str. >>> random.seed(200) >>> Art = text2art("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#$%&'()*+,-./:;<=>?@[\]^_`{|}~0123456789","rnd-small") >>> random.seed(800)