2 tests fail: No module named 'test_trade'
- OS: FreeBSD 13.1
- Programming Language version: Python-3.9
- CCXT version: 2.4.60
pytest fails:
=========================================================================================== ERRORS ===========================================================================================
__________________________________________________________________________ ERROR collecting ccxt/test/test_async.py __________________________________________________________________________
ImportError while importing test module '/usr/ports/finance/py-ccxt/work-py39/ccxt-2.4.60/ccxt/test/test_async.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ccxt/test/test_async.py:22: in <module>
from test_trade import test_trade # noqa: E402
E ModuleNotFoundError: No module named 'test_trade'
__________________________________________________________________________ ERROR collecting ccxt/test/test_sync.py ___________________________________________________________________________
ImportError while importing test module '/usr/ports/finance/py-ccxt/work-py39/ccxt-2.4.60/ccxt/test/test_sync.py'.
Hint: make sure your test modules/packages have valid Python names.
Traceback:
/usr/local/lib/python3.9/importlib/__init__.py:127: in import_module
return _bootstrap._gcd_import(name[level:], package, level)
ccxt/test/test_sync.py:21: in <module>
from test_trade import test_trade # noqa: E402
E ModuleNotFoundError: No module named 'test_trade'
====================================================================================== warnings summary ======================================================================================
ccxt/test/test_throttle.py:109
/usr/ports/finance/py-ccxt/work-py39/ccxt-2.4.60/ccxt/test/test_throttle.py:109: DeprecationWarning: The explicit passing of coroutine objects to asyncio.wait() is deprecated since Python 3.8, and scheduled for removal in Python 3.11.
await asyncio.wait([schedule(case) for case in test_cases], return_when=asyncio.ALL_COMPLETED)
../../../../../local/lib/python3.9/site-packages/pytest_freezegun.py:17: 18 warnings
/usr/local/lib/python3.9/site-packages/pytest_freezegun.py:17: DeprecationWarning: distutils Version classes are deprecated. Use packaging.version instead.
if LooseVersion(pytest.__version__) < LooseVersion('3.6.0'):
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! Interrupted: 2 errors during collection !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
============================================================================== 19 warnings, 2 errors in 12.61s ===============================================================================
*** Error code 2
The file is there https://github.com/ccxt/ccxt/blob/master/python/ccxt/test/test_trade.py
can you again update and re-test? btw, what about antivirus marking is accidentally?
I have no other ideas atm.
How did you run the tests? please give the complete details.
I build from the tarball on PyPI.
These 2 files exist:
./ccxt/test/test_trade.py
./build/lib/ccxt/test/test_trade.py
Can you please try to install using wheel (instead of tarball)?
might be related: https://stackoverflow.com/questions/31401762/python-packaging-wheels-vs-tarball-tar-gz https://stackoverflow.com/questions/22430150/pypi-tarball-includes-files-that-arent-in-the-dist-package
Wheels contain OS-specific binaries, and FreeBSD wheels aren't available from PyPI.
Tests weren't run from the ccxt/test subfolder - this was the cause.