mastodon.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
The original server operated by the Mastodon gGmbH non-profit

Administered by:

Server stats:

380K
active users

#mock

1 post1 participant0 posts today

pytest-mock : Mocking in pytest
Test & Code episode
testandcode.com/episodes/pytes
- Why the pytest-mock plugin is awesome
- Mocking, patching, monkeypatching
- Mocks, fakes, stubs and spies
- Why do we need these for testing
- pytest-mock as a curated wrapper around unittest.mock
#Python #pytest #mock

Test & CodeTest & Code | pytest-mock : Mocking in pytestpytest-mock is currently the #3 pytest plugin. pytest-mock is a wrapper around unittest.mock.In this episode:What is mocking, patching, and monkey patchingWhat, if any, is the difference between mo...

Mocha v3.0.0-rc.1 released

Looking for people to test the release candidate! 🙏

Highlights:

* Allow keyword arguments to match an expectation expecting *only* positional arguments
* Explicit support for Ruby v3.4
* Freeze all string literals used internally
* Use Ruby v1.9 Hash syntax in failure messages
* Drop support for Ruby v2.1
* Drop support for Minitest < v5

rubygems.org/gems/mocha/versio

Thanks to Herwin W, Nicholaus Ames, Sean Dilda & @drewnovo.

rubygems.orgmocha | RubyGems.org | your community gem host
#ruby#testing#mock

Mocha v2.6.1 released

* Fix logic added in v2.6.0 for displaying deprecation warnings for expectation with never cardinality - thanks to @DavidStosik for reporting.

The following will still pass despite an erroneous deprecation warning displayed in v2.6.0 suggesting otherwise:

foo.expects(:bar).never
foo.expects(:bar).once
foo.bar

rubygems.org/gems/mocha/versio

rubygems.orgmocha | RubyGems.org | your community gem host
#ruby#testing#mock

Mocha v2.6.0 released

* Expectation with never cardinality should display deprecation warning - thanks to Duke Tran for reporting and testing.

In anticipation of fixing a long-time bug so that the following will fail fast instead of passing:

foo.stubs(:bar)
foo.expects(:bar).never
foo.bar # => deprecation warning / unexpected invocation error

rubygems.org/gems/mocha/versio

rubygems.orgmocha | RubyGems.org | your community gem host
#ruby#testing#mock
Replied in thread

@astraluma

It depends on what, exactly, you want. time.localtime() will give you a value in the system's configured #timezone. time.gmtime() will give you #UTC. The difference between those will tell you the current local time's offset from UTC.

If you want the name of the configured timezone, on many Unix-type systems, you can read /etc/timezone to get it.

If you want more specific info about a timezone, you can add an external dependency which includes (or provides access to a system-provided) database of timezone info. This stuff changes often, and is decided politically rather than technically, so it's a moving target and the #Python #stdlib doesn't try to include it. `pytz` is one such package with a fairly complete database.

And you can easily override any of these in a test framework. Using unittest.mock.MagicMock(), for example, lets you override any of the above with whatever value you want those functions to return.

#pytz#test#mock

Ускоряем разработку и тестирование с DevTools: 4 новых инструмента, которые сэкономят вам время

Отладка и тестирование — основа нашей работы, но они могут быть утомительными и отнимать много времени. Поэтому сегодня я расскажу о четырех новых фичах в DevTools, которые помогут тестировщикам и разработчикам работать быстрее и эффективнее. Эти инструменты созданы специально, чтобы упростить рутинные задачи отладки и анализа производительности. Давайте разберем, как они работают.

habr.com/ru/articles/854274/

ХабрУскоряем разработку и тестирование с DevTools: 4 новых инструмента, которые сэкономят вам времяОтладка и тестирование — основа нашей работы, но они могут быть утомительными и отнимать много времени. Поэтому сегодня я расскажу о четырех новых фичах в DevTools, которые помогут тестировщикам и...