git.net

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Problem while integrating unittest with setuptools


Finally I found why my setup.py dosen't work. I didn't put a `__init__.py` in my `test` folder, thus Python dosen't think it's a package. That's why it found the wrong package.

Thank you.

On Mon, Sep 02, 2019 at 04:28:50PM +0200, dieter wrote:
> YuXuan Dong <yuxuan.dong at outlook.com> writes:
> > I have uninstalled `six` using `pip uninstall six` but the problem is still there.
> 
> Your traceback shows that `six` does not cause your problem.
> It is quite obvious that a `test_winreg` will want to load the
> `wingreg` module.
> 
> > As you suggested, I have checked the traceback and found the exception is caused by `/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test/test_winreg.py` on my machine with homebrew-installed Python3.
> >
> > I have realized that the problem may be caused of `test-suite=test` in my `setup.py`. `setuptools` will find the `test` package. But the package it found is not in my project. It found `/usr/local/Cellar/python/3.7.3/Frameworks/Python.framework/Versions/3.7/lib/python3.7/test`.
> 
> Yes. Apparently, you run the Python test suite - and depending on
> platform and available infrastructure some of its tests fail.
> 
> In my package `dm.xmlsec.binding` I use
> `test_suite='dm.xmlsec.binding.tests.testsuite'`.
> Maybe, you can ensure to get the correct test suite in a similar
> way for your package.
> 
> -- 
> https://mail.python.org/mailman/listinfo/python-list