ampledata / kiss

A pure-Python implementation of the KISS Protocol for communicating with serial TNC devices for use with Amateur Radio.
Other
85 stars 35 forks source link

make test fails in linux #31

Open hemna opened 1 year ago

hemna commented 1 year ago

just cloned a fresh copy of the repo and tried to run make test.

git cone the repo make a virtualenv and install the requirements from requirements.txt run make test

└─> make test
zsh: correct 'test' to 'tests' [nyae]? n

Hello from the Makefile...
Don't forget to run: 'make install_requirements'

pylint --msg-template="{path}:{line}: [{msg_id}({symbol}), {obj}] {msg}" \
    -r n --ignore-imports=y kiss/*.py tests/*.py || exit 0

************* Module kiss.classes
kiss/classes.py:44: [R0022(useless-option-value), ] Useless option value for 'disable', 'R0201' was moved to an optional extension, see https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers.
kiss/classes.py:50: [R0022(useless-option-value), ] Useless option value for 'disable', 'R0201' was moved to an optional extension, see https://pylint.pycqa.org/en/latest/whatsnew/2/2.14/summary.html#removed-checkers.
kiss/classes.py:159: [W0511(fixme), ] TODO: What do I do?
kiss/classes.py:9: [E0401(import-error), ] Unable to import 'serial'
kiss/classes.py:18: [R0205(useless-object-inheritance), KISS] Class 'KISS' inherits from object, can be safely removed from bases in python3
kiss/classes.py:60: [W0107(unnecessary-pass), KISS.stop] Unnecessary pass statement
kiss/classes.py:66: [W0107(unnecessary-pass), KISS.start] Unnecessary pass statement
kiss/classes.py:110: [E1111(assignment-from-no-return), KISS.read] Assigning result of a function call, where the function has no return
kiss/classes.py:126: [E1135(unsupported-membership-test), KISS.read] Value 'read_data' doesn't support membership test
kiss/classes.py:126: [E1135(unsupported-membership-test), KISS.read] Value 'read_data' doesn't support membership test
kiss/classes.py:212: [R1725(super-with-arguments), TCPKISS.__init__] Consider using Python 3 style super() without arguments
kiss/classes.py:224: [W0221(arguments-differ), TCPKISS.start] Variadics removed in overridden 'TCPKISS.start' method
kiss/classes.py:244: [R1725(super-with-arguments), SerialKISS.__init__] Consider using Python 3 style super() without arguments
kiss/classes.py:292: [W0212(protected-access), SerialKISS.stop] Access to a protected member _isOpen of a client class
************* Module kiss.exceptions
kiss/exceptions.py:13: [W0107(unnecessary-pass), SocketClosetError] Unnecessary pass statement
************* Module tests.context
tests/context.py:14: [C0413(wrong-import-position), ] Import "from . import kiss_test_classes" should be placed at the top of the module
************* Module tests.kiss_test_classes
tests/kiss_test_classes.py:10: [E0401(import-error), ] Unable to import 'aprs'
tests/kiss_test_classes.py:47: [C0116(missing-function-docstring), KISSTestClass.print_frame] Missing function or method docstring
tests/kiss_test_classes.py:48: [C0209(consider-using-f-string), KISSTestClass.print_frame] Formatting a regular string which could be a f-string
************* Module tests.test_kiss_util
tests/test_kiss_util.py:24: [R1732(consider-using-with), KISSUtilTestCase.setUp] Consider using 'with' for resource-allocating operations
************* Module tests.test_serialkiss
tests/test_serialkiss.py:63: [W0511(fixme), ] FIXME: Currently broken.
tests/test_serialkiss.py:8: [E0401(import-error), ] Unable to import 'aprs'
tests/test_serialkiss.py:9: [E0401(import-error), ] Unable to import 'dummyserial'
tests/test_serialkiss.py:27: [R1732(consider-using-with), SerialKISSTestCase.setUp] Consider using 'with' for resource-allocating operations
tests/test_serialkiss.py:41: [C0116(missing-function-docstring), SerialKISSTestCase.test_write] Missing function or method docstring
tests/test_serialkiss.py:42: [C0103(invalid-name), SerialKISSTestCase.test_write] Variable name "ks" doesn't conform to snake_case naming style
tests/test_serialkiss.py:44: [W0212(protected-access), SerialKISSTestCase.test_write] Access to a protected member _write_handler of a client class
tests/test_serialkiss.py:92: [C0103(invalid-name), SerialKISSTestCase.test_write_and_read] Variable name "ks" doesn't conform to snake_case naming style
tests/test_serialkiss.py:100: [W0212(protected-access), SerialKISSTestCase.test_write_and_read] Access to a protected member _write_handler of a client class
tests/test_serialkiss.py:103: [W0212(protected-access), SerialKISSTestCase.test_write_and_read] Access to a protected member _read_handler of a client class
tests/test_serialkiss.py:103: [W0612(unused-variable), SerialKISSTestCase.test_write_and_read] Unused variable 'read_data'
tests/test_serialkiss.py:108: [C0103(invalid-name), SerialKISSTestCase.test_config_xastir] Variable name "ks" doesn't conform to snake_case naming style
tests/test_serialkiss.py:115: [W0212(protected-access), SerialKISSTestCase.test_config_xastir] Access to a protected member _write_handler of a client class
************* Module tests.test_tcpkiss
tests/test_tcpkiss.py:71: [W0511(fixme), ] FIXME: Broken.
tests/test_tcpkiss.py:8: [E0401(import-error), ] Unable to import 'aprs'
tests/test_tcpkiss.py:10: [E0401(import-error), ] Unable to import 'mocket.mocket'
tests/test_tcpkiss.py:29: [R1732(consider-using-with), TCPKISSTestCase.setUp] Consider using 'with' for resource-allocating operations
tests/test_tcpkiss.py:45: [C0209(consider-using-f-string), TCPKISSTestCase._test_write] Formatting a regular string which could be a f-string
tests/test_tcpkiss.py:54: [C0103(invalid-name), TCPKISSTestCase._test_write] Variable name "ks" doesn't conform to snake_case naming style
tests/test_tcpkiss.py:55: [C0103(invalid-name), TCPKISSTestCase._test_write] Variable name "a" doesn't conform to snake_case naming style
tests/test_tcpkiss.py:63: [W0212(protected-access), TCPKISSTestCase._test_write] Access to a protected member _write_handler of a client class
tests/test_tcpkiss.py:65: [C0321(multiple-statements), TCPKISSTestCase._test_write._pass] More than one statement on a single line
tests/test_tcpkiss.py:76: [C0209(consider-using-f-string), TCPKISSTestCase.test_write_and_read] Formatting a regular string which could be a f-string
tests/test_tcpkiss.py:85: [C0103(invalid-name), TCPKISSTestCase.test_write_and_read] Variable name "ks" doesn't conform to snake_case naming style
tests/test_tcpkiss.py:86: [C0103(invalid-name), TCPKISSTestCase.test_write_and_read] Variable name "a" doesn't conform to snake_case naming style
tests/test_tcpkiss.py:93: [W0212(protected-access), TCPKISSTestCase.test_write_and_read] Access to a protected member _write_handler of a client class
tests/test_tcpkiss.py:95: [C0321(multiple-statements), TCPKISSTestCase.test_write_and_read._pass] More than one statement on a single line
tests/test_tcpkiss.py:89: [W0612(unused-variable), TCPKISSTestCase.test_write_and_read] Unused variable 'entry_1'
tests/test_tcpkiss.py:10: [W0611(unused-import), ] Unused MocketSocket imported from mocket.mocket
tests/test_tcpkiss.py:1: [R0801(duplicate-code), ] Similar lines in 2 files
==kiss.classes:[192:198]
==tests.test_serialkiss:[83:89]
        frame_kiss = ''.join([
            kiss.FEND,
            kiss.DATA_FRAME,
            frame_escaped,
            kiss.FEND
        ])
tests/test_tcpkiss.py:1: [R0401(cyclic-import), ] Cyclic import (kiss -> kiss.classes)
tests/test_tcpkiss.py:1: [R0401(cyclic-import), ] Cyclic import (kiss -> kiss.util)
tests/test_tcpkiss.py:1: [R0401(cyclic-import), ] Cyclic import (tests.context -> tests.kiss_test_classes)

-----------------------------------
Your code has been rated at 7.79/10

flake8 --max-complexity 12 --exit-zero kiss/*.py tests/*.py
kiss/classes.py:31:44: E252 missing whitespace around parameter equals
kiss/classes.py:31:45: E252 missing whitespace around parameter equals
kiss/classes.py:240:38: E252 missing whitespace around parameter equals
kiss/classes.py:240:39: E252 missing whitespace around parameter equals
tests/test_serialkiss.py:103:9: F841 local variable 'read_data' is assigned to but never used
tests/test_tcpkiss.py:10:1: F401 'mocket.mocket.MocketSocket' imported but unused
tests/test_tcpkiss.py:89:9: F841 local variable 'entry_1' is assigned to but never used
python setup.py nosetests
/home/waboring/devel/hamradio/kiss/.venv/lib/python3.8/site-packages/setuptools/installer.py:27: SetuptoolsDeprecationWarning: setuptools.installer is deprecated. Requirements should be satisfied by a PEP 517 installer.
  warnings.warn(
running nosetests
running egg_info
creating kiss.egg-info
writing kiss.egg-info/PKG-INFO
writing dependency_links to kiss.egg-info/dependency_links.txt
writing requirements to kiss.egg-info/requires.txt
writing top-level names to kiss.egg-info/top_level.txt
writing manifest file 'kiss.egg-info/SOURCES.txt'
reading manifest file 'kiss.egg-info/SOURCES.txt'
reading manifest template 'MANIFEST.in'
adding license file 'LICENSE'
writing manifest file 'kiss.egg-info/SOURCES.txt'
...ES
======================================================================
ERROR: Failure: ImportError (cannot import name 'portNotOpenError' from 'serial.serialutil' (/home/waboring/devel/hamradio/kiss/.eggs/pyserial-3.5-py3.8.egg/serial/serialutil.py))
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/waboring/devel/hamradio/kiss/.eggs/nose-1.3.7-py3.8.egg/nose/failure.py", line 39, in runTest
    raise self.exc_val.with_traceback(self.tb)
  File "/home/waboring/devel/hamradio/kiss/.eggs/nose-1.3.7-py3.8.egg/nose/loader.py", line 417, in loadTestsFromName
    module = self.importer.importFromPath(
  File "/home/waboring/devel/hamradio/kiss/.eggs/nose-1.3.7-py3.8.egg/nose/importer.py", line 47, in importFromPath
    return self.importFromDir(dir_path, fqname)
  File "/home/waboring/devel/hamradio/kiss/.eggs/nose-1.3.7-py3.8.egg/nose/importer.py", line 94, in importFromDir
    mod = load_module(part_fqname, fh, filename, desc)
  File "/home/waboring/.pyenv/versions/3.8.8/lib/python3.8/imp.py", line 234, in load_module
    return load_source(name, filename, file)
  File "/home/waboring/.pyenv/versions/3.8.8/lib/python3.8/imp.py", line 171, in load_source
    module = _load(spec)
  File "<frozen importlib._bootstrap>", line 702, in _load
  File "<frozen importlib._bootstrap>", line 671, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 783, in exec_module
  File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
  File "/home/waboring/devel/hamradio/kiss/tests/test_serialkiss.py", line 9, in <module>
    import dummyserial
  File "/home/waboring/devel/hamradio/kiss/.eggs/dummyserial-1.0.0-py3.8.egg/dummyserial/__init__.py", line 17, in <module>
    from .classes import Serial  # NOQA
  File "/home/waboring/devel/hamradio/kiss/.eggs/dummyserial-1.0.0-py3.8.egg/dummyserial/classes.py", line 11, in <module>
    from serial.serialutil import SerialException, portNotOpenError
ImportError: cannot import name 'portNotOpenError' from 'serial.serialutil' (/home/waboring/devel/hamradio/kiss/.eggs/pyserial-3.5-py3.8.egg/serial/serialutil.py)

Name                 Stmts   Miss  Cover
----------------------------------------
kiss/__init__.py         8      0   100%
kiss/classes.py        154    111    28%
kiss/constants.py       39      2    95%
kiss/exceptions.py       6      0   100%
kiss/util.py            20      6    70%
----------------------------------------
TOTAL                  227    119    48%
----------------------------------------------------------------------
Ran 5 tests in 0.332s

FAILED (SKIP=1, errors=1)
make: *** [Makefile:44: nosetests] Error 1