2 ms·
> I've never used rspec but it sounds like pytest and hypothesis would do the job Sorry it really does not, having factorybot + rspec + rspec-mocks really is a
by realusername 5y ago
> I've never used rspec but it sounds like pytest and hypothesis would do the job
Sorry it really does not, having factorybot + rspec + rspec-mocks really is a super power when it comes in testing.
The issue is that most of the time I land on a django project, it has really poor testing whereas most of the time I land on a Rails project, it has very close to complete testing. The reason is that the tests are more tedious to write.
And this culture trickles down to your dependencies as well. Anything you install with rails is almost guaranteed to have the upmost quality of testing.
- m_ke 5y agoTesting django with pytest is super easy (ex: https://dev.to/sherlockcodes/pytest-with-django-rest-framework-from-zero-to-hero-8c4 https://dev.to/sherlockcodes/pytest-with-django-rest-framewo...)
- realusername 5y agoIt's nowhere near as equivalent, where's the behavior testing? Where is stuff like allow_any_instance_of(...).to receive(...).and_return(...)? What about shared examples? How can you patch globally the current time? Where are partial matchers like an_object_having_attributes? What about automatic db rollbacks? Have a look on the examples here https://github.com/rspec/rspec-mocks https://github.com/rspec/rspec-mocks