Comments (6)
Probably pytest is somehow incompatible with tests in aioitertools. I use the following command to run tests:
python -m unittest -v aioitertools.tests
from aioitertools.
Don't get me wong but I'm tryuing to standarise all my packahhes with python modules arounfd use pytest on test suite execution.
[tkloczko@devel-g2v SPECS]$ grep ^%pytest python-* | wc -l; ls -1 python-*|wc -l
1002
1024
as you see I've been able to use that methodology with +98% of all my packages with python modules.
Other issue in latest version is that aioitertools/tests content is installed.
Test suite should not be installed.
I made anotehr experiment:
+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-aioitertools-0.10.0-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-aioitertools-0.10.0-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra aioitertools/tests/*py
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.13, pytest-7.1.3, pluggy-1.0.0
rootdir: /home/tkloczko/rpmbuild/BUILD/aioitertools-0.10.0
collected 127 items
aioitertools/tests/asyncio.py ............. [ 10%]
aioitertools/tests/builtins.py ..................................... [ 39%]
aioitertools/tests/helpers.py ..... [ 43%]
aioitertools/tests/itertools.py ................................................................. [ 94%]
aioitertools/tests/more_itertools.py ....... [100%]
============================================================================= warnings summary =============================================================================
aioitertools/tests/helpers.py::HelpersTest::test_maybe_await_coroutine
/home/tkloczko/rpmbuild/BUILD/aioitertools-0.10.0/aioitertools/tests/helpers.py:43: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
def forty_two():
-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====================================================================== 127 passed, 1 warning in 2.47s ======================================================================
So clearly looks like some bits are missing ..
from aioitertools.
Interesting! Looks like pytest only considers test_*.py
or *_test.py
files, and aioitertools does not use such filenames. Maybe it's good to switch to such filenames - it's up to maintainers, anyway.
See: https://docs.pytest.org/en/7.1.x/explanation/goodpractices.html#test-discovery
from aioitertools.
Good catch .. I was not awate of tjat 😋
So probably raname files in tests/ should fix that ..
And pleass add to exclude tests/ content on assemmbly .whl 😋
from aioitertools.
I'm sorry, but I don't plan to do either of these. I don't use pytest, and I don't like its insistence on using repetitive naming schemes for everything. The official way to run the test suite is via the stdlib unittest module, as yan mentioned above. You are free to use pytest if you like, or any other testing framework, but that's up to you to make that work with the project; it looks like you already found a way to make it run the test suite as-is.
I likewise have no plans to remove the test suite from the wheels. They are useful for validating the package's functionality after installation, and they are intentionally inside the main package's namespace so that they don't conflict with any other package. They are also small enough that I see no meaningful benefit from leaving them out. Distro packaging systems are free to remove them if they want, but they can't easily be added back in by users who do want to have them.
from aioitertools.
FYI: corectly written unittest test suite can be correcrly handled by pytest.
Is is really so bad to rename few fiels? 🤔
from aioitertools.
Related Issues (20)
- isinstance check order of iter method HOT 1
- 0.10.0: sphinx warnings `reference target not found`
- python version req mismatch
- bug in zip_longest
- Tests fail with Python 3.11
- Add `chunked` that accepts `AsyncIterator` HOT 1
- Platform independent encoding on setup.py
- aioitertools.zip is doing strange things with exceptions HOT 3
- Package description is wrong
- min max missing? HOT 1
- RuntimeError: anext(): asynchronous generator is already running (Python 3.8) HOT 3
- Functions returning awaitables are not always handled properly
- `builtins.next` missing optional `default` parameter.
- Peeking into an iterator HOT 1
- Allow slightly unbalanced consumption in tee HOT 1
- New release? HOT 2
- zip should cancel unfinished awaitables on stop
- Not working with Python 3.10 HOT 1
- Would be great to have a concurrency-limited version of gather
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aioitertools.