mccabe icon indicating copy to clipboard operation
mccabe copied to clipboard

0.7: test failure

Open 0-wiz-0 opened this issue 2 years ago • 2 comments

When running the self tests on the pypi sdist file, I see:

# setup.py  test
running test
WARNING: Testing via this command is deprecated and will be removed in a future version. Users looking for a generic test entry point independent of test runner are encouraged to use tox.
running egg_info
writing manifest file 'mccabe.egg-info/SOURCES.txt'
running build_ext
test_mccabe (unittest.loader._FailedTest) ... ERROR

======================================================================
ERROR: test_mccabe (unittest.loader._FailedTest)
----------------------------------------------------------------------
ImportError: Failed to import test module: test_mccabe
Traceback (most recent call last):
  File "/usr/pkg/lib/python3.10/unittest/loader.py", line 436, in _find_test_path
    module = self._get_module_from_name(name)
  File "/usr/pkg/lib/python3.10/unittest/loader.py", line 377, in _get_module_from_name
    __import__(name)
  File "/scratch/devel/py-mccabe/work/mccabe-0.7.0/test_mccabe.py", line 244, in <module>
    @settings(
NameError: name 'settings' is not defined


----------------------------------------------------------------------
Ran 1 test in 0.000s

I see that it trys to import hypothesmith, but this is not installed on my system, and it has an except clause just ignoring the problem.

0-wiz-0 avatar Jan 31 '22 11:01 0-wiz-0

It looks like the problem is that while there is a check for whether or not hyphothesmith is available, later in the test file it blindly assumes it is.

(Also ran into this trying to package for Arch Linux.)

alerque avatar Feb 22 '22 06:02 alerque

We're seeing the same problem on NixOS just now.

mweinelt avatar Mar 30 '22 23:03 mweinelt

Proposed fix: #92

mtelka avatar Nov 18 '22 22:11 mtelka

see #92

asottile avatar Dec 03 '23 13:12 asottile

see #93

This is #93.

mweinelt avatar Dec 03 '23 14:12 mweinelt