Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/phantie/contests
Concise predicative testing of iterables
https://github.com/phantie/contests
iterables no-dependencies predicative-testing python
Last synced: about 2 months ago
JSON representation
Concise predicative testing of iterables
- Host: GitHub
- URL: https://github.com/phantie/contests
- Owner: phantie
- License: mit
- Created: 2021-03-09T03:47:39.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2024-11-16T13:18:15.000Z (3 months ago)
- Last Synced: 2024-12-07T17:03:08.457Z (about 2 months ago)
- Topics: iterables, no-dependencies, predicative-testing, python
- Language: Python
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.rst
- License: LICENSE
Awesome Lists containing this project
README
.. code:: python
from contests import some, every, some_not, noone
assert some("Abc").isupper() == any(i.isupper() for i in "Abc")
assert every("one").islower() == all(i.islower() for i in "one")
assert some_not("Abc").islower() == (not all(i.islower() for i in "Abc"))
assert noone("abc").isupper() == (not any(i.isupper() for i in "abc"))assert some([1, 1, 1, 2, 1]) == 2
assert every([1, 2, 3, 4, 5]) > 0
assert some("bbbbabbb") != "b"assert some["(", ")"] == "("
assert some([1]) == 1Install:
::pip install git+https://github.com/phantie/contests.git