Giter VIP home page Giter VIP logo

Comments (6)

yan12125 avatar yan12125 commented on August 18, 2024

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.

kloczek avatar kloczek commented on August 18, 2024

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.

yan12125 avatar yan12125 commented on August 18, 2024

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.

kloczek avatar kloczek commented on August 18, 2024

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.

amyreese avatar amyreese commented on August 18, 2024

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.

kloczek avatar kloczek commented on August 18, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.