grappa-py / grappa

Behavior-oriented, expressive, human-friendly Python assertion library for the 21st century
http://grappa.rtfd.io
MIT License
134 stars 15 forks source link

Fixes #53, #55, #48, #59 (partially) and added mock call operators #64

Closed sgissinger closed 3 years ago

sgissinger commented 3 years ago

I don't know why, MagicMock operators do not works with | should assertion style.

h2non commented 3 years ago

Thanks for the PR and work done here!

Would you mind fixing the CI builds with code format issues? https://travis-ci.org/github/grappa-py/grappa/builds/744179148

sgissinger commented 3 years ago

You're welcome. Java-style assertions are so painful, I will never go back to these things :smiley:.

I added a GitHub Action workflow for the fun. One advantage over Travis CI is that it runs almost instantly and on all types of OSes. For PyPy2 I have the same errors on been_called operators tests

sgissinger commented 3 years ago

Hello @h2non , I would like your advice about the last Travis CI run.

PyPy fails on tests and this is the only platform to fail. https://travis-ci.org/github/grappa-py/grappa/jobs/744398943

I do not really like that, but I could disable these tests when they are run in PyPy2.

import platform

implementation = platform.python_implementation()
major = platform.python_version_tuple()[0]

if implementation != 'PyPy' and major != '2':
    # run tests that are buggy on PyPy2

PS: GitHub Actions also fails in the same context with the same test. https://github.com/sgissinger/grappa/runs/1417734198

sgissinger commented 3 years ago

I could also set up Travis CI to allow failures on PyPy, but it will always fail...

jobs:
  allow_failures:
    - python: pypy
sgissinger commented 3 years ago

@h2non I promise I stop to push 'til you choose to merge now :-)

h2non commented 3 years ago

Thanks for the nice work here.

New version v1.0.0 is now available on PyPI: https://pypi.org/project/grappa/

Upgrade it by running: pip install --upgrade grappa