Redis fixtures and fixture factories for Pytest.

Overview

https://raw.githubusercontent.com/ClearcodeHQ/pytest-redis/master/logo.png

pytest-redis

Latest PyPI version Wheel Status Supported Python Versions License

What is this?

This is a pytest plugin, that enables you to test your code that relies on a running Redis database. It allows you to specify additional fixtures for Redis process and client.

How to use

Plugin contains three fixtures

  • redisdb - This is a redis client fixture. It constructs a redis client and cleans redis database after the test.
    It relies on redis_proc fixture, and as such the redis process is started at the very beginning of the first test using this fixture, and stopped after the last test finishes.
  • redis_proc - session scoped fixture, that starts Redis instance at it's first use and stops at the end of the tests.
  • redis_nooproc - a nooprocess fixture, that's connecting to already running redis

Simply include one of these fixtures into your tests fixture list.

#
def test_redis(redisdb):
    """Check that it's actually working on redis database."""
    redisdb.set('test1', 'test')
    redisdb.set('test2', 'test')

    my_functionality = MyRedisBasedComponent()
    my_functionality.do_something()
    assert my_functionality.did_something

    assert redisdb.get("did_it") == 1

For the example above works like following:

  1. pytest runs tests
  2. redis_proc starts redis database server
  3. redisdb creates client connection to the server
  4. test itself runs and finishes
  5. redisdb cleans up the redis
  6. redis_proc stops server (if that was the last test using it)
  7. pytest ends running tests

You can also create additional redis client and process fixtures if you'd need to:

from pytest_redis import factories

redis_my_proc = factories.redis_proc(port=None)
redis_my = factories.redisdb('redis_my_proc')

def test_my_redis(redis_my):
    """Check that it's actually working on redis database."""
    redis_my.set('test1', 'test')
    redis_my.set('test2', 'test')

    my_functionality = MyRedisBasedComponent()
    my_functionality.do_something()
    assert my_functionality.did_something

    assert redis_my.get("did_it") == 1

Note

Each Redis process fixture can be configured in a different way than the others through the fixture factory arguments.

Connecting to already existing redis database

Some projects are using already running redis servers (ie on docker instances). In order to connect to them, one would be using the redis_nooproc fixture.

redis_external = factories.redisdb('redis_nooproc')

def test_redis(redis_external):
    """Check that it's actually working on redis database."""
    redis_external.set('test1', 'test')
    redis_external.set('test2', 'test')

    my_functionality = MyRedisBasedComponent()
    my_functionality.do_something()
    assert my_functionality.did_something

    assert redis_external.get("did_it") == 1

By default the redis_nooproc fixture would connect to Redis instance using 6379 port. Standard configuration options apply to it.

These are the configuration options that are working on all levels with the redis_nooproc fixture:

Configuration

You can define your settings in three ways, it's fixture factory argument, command line option and pytest.ini configuration option. You can pick which you prefer, but remember that these settings are handled in the following order:

  • Fixture factory argument
  • Command line option
  • Configuration option in your pytest.ini file
Configuration options
Redis server option Fixture factory argument Command line option pytest.ini option Noop process fixture Default
executable executable --redis-exec redis_exec
/usr/bin/redis-server
host host --redis-host redis_host host 127.0.0.1
port port --redis-port redis_port port random
connection timeout timeout --redis-timeout redis_timeout
30
number of databases db_count --redis-db-count redis_db_count
8
Whether to enable logging to the system logger syslog --redis-syslog redis_syslog
False
Redis log verbosity level loglevel --redis-loglevel redis_loglevel
notice
Compress dump files compress --redis-compress redis_compress
True
Add checksum to RDB files checksum --redis-rdbcompress redis_rdbchecksum
False
Save configuration save --redis-save redis_save
""
Redis test instance data directory path datadir --redis-datadir redis_datadir
""

Example usage:

  • pass it as an argument in your own fixture

    redis_proc = factories.redis_proc(port=8888)
  • use --redis-port command line option when you run your tests

    py.test tests --redis-port=8888
    
  • specify your port as redis_port in your pytest.ini file.

    To do so, put a line like the following under the [pytest] section of your pytest.ini:

    [pytest]
    redis_port = 8888

Options below are for configuring redis client fixture.

Redis client option Fixture factory argument Command line option pytest.ini option Default
decode_response decode --redis-decode redis_decode False

Package resources

Comments
  • Continuous integration with bitbucket: Bad path to redis_exec is given: /usr/local/bin/redis-server not exists or wrong program

    Continuous integration with bitbucket: Bad path to redis_exec is given: /usr/local/bin/redis-server not exists or wrong program

    What action do you want to perform

    • CI with bitbucket pipelines, using redis image as service, listening on localhost 6379

    What are the results

    E pytest_redis.executor.RedisMisconfigured: Bad path to redis_exec is given: /usr/local/bin/redis-server not exists or wrong program

    What are the expected results

    Tests requiring redisdb fixture run fine.


    Cross-posting https://community.atlassian.com/t5/Bitbucket-questions/How-do-I-use-Redis-in-Bitbucket-Pipelines/qaq-p/461915

    question 
    opened by benjaminweb 9
  • Generated socket files are to long

    Generated socket files are to long

    What action do you want to perform

    I want to use pytest-redis on OS X . I made a simplified test function based on the documentation

    def test_my_redis(redisdb):
            """Check that it's actually working on redis database."""
            redisdb.set('test1', 'test')
            redisdb.set('test2', 'test')
        
        
            assert redisdb.get("test1") == 1
    

    What are the results

    The following error is raised: redis.exceptions.ConnectionError: Error connecting to unix socket: /private/var/folders/s9/fpx7c2mj6cj4y80p28bt7c3m0000gn/T/pytest-of-maartenderickx/pytest-3/pytest-redis-redis_proc0/redis.29482.sock. AF_UNIX path too long.

    What are the expected results

    a succesfully run testcase where no error is raised but instead the test has failed because 'test' is not equal to 1

    enhancement macos 
    opened by koffie 6
  • LICENSE question

    LICENSE question

    Hi, thank you for the project!

    There are some situations where I can't use LGPL on some of my python projects. The reason why is the license isn't framed in the sense of a scripting language and it's quite a big list of terms compared to the alternatives. Is there any more information on using LGPL over the license pytest itself uses?

    I can provide more details / specific cases if it's helpful. The reason why is when I brought LGPL to a lawyer (in USA) there were concerns with side effects that could happen down the road due to its language around derivatives.

    Are you open to using a license the same as pytest itself? If it were only for the sake of congruence with pytest and other pytest plugins?

    opened by tony 6
  • Conda package

    Conda package

    For the time being we've added pytest-redis (and mirakuru) to own conda channel:

    https://anaconda.org/esrf-bcu/pytest-redis

    Would it be possible to add it to conda-forge?

    enhancement 
    opened by woutdenolf 5
  • Retry Support

    Retry Support

    What action do you want to perform

    We are running into occasional test failures, because of a race condition between test execution and the redis server accepting connections. When using the redisdb fixture, there seems to be no Retry policy setup, because by default the Connection class uses NoBackoff.

    What are the results

    Test fixture waits until the server is ready before continuing.

    I'd be happy to contribute this.

    Ideally if we could provide the redis.retry.Retry and redis.backoff module contents and accept an additional parameter from the caller to configure retries, it would probably be the least of effort?

    bug 
    opened by romanofski 5
  • [question] session scope fixture

    [question] session scope fixture

    Does pytest-redis have session scope fixtures? I want to to this by redisdb has the wrong scope:

    @pytest.fixture(scope="session")
    def myfixture(redisdb):
        ...
    
    question 
    opened by woutdenolf 5
  • Bump mirakuru from 2.3.0 to 2.3.1

    Bump mirakuru from 2.3.0 to 2.3.1

    ⚠️ Dependabot Preview has been deactivated ⚠️

    This pull request was created by Dependabot Preview, and you've upgraded to Dependabot. This means it won't respond to dependabot commands nor will it be automatically closed if a new version is found.

    If you close this pull request, Dependabot will re-create it the next time it checks for updates and everything will work as expected.


    Bumps mirakuru from 2.3.0 to 2.3.1.

    Changelog

    Sourced from mirakuru's changelog.

    2.3.1

    Misc

    • Moved CI to Github Actions
    • Blackified codebase
    • Compacted Documentation into readme (was pretty small anyway)
    Commits
    • 676cf00 "Release 2.3.1"
    • 4b5cb9f Updated bumpversion and cleanup readme badges
    • 8610e8c Merge pull request #455 from ClearcodeHQ/nodocs
    • 39a422c Move relevant docs to README, mention Windows Support - closes #453
    • 408781f Merge pull request #452 from fizyk/cfg
    • b9aef2a Define package in setup.cfg instead of setup.py
    • 6192691 Merge pull request #450 from ClearcodeHQ/dependabot/pip/black-21.5b0
    • 581f316 Update black github action
    • 7bf7176 Run test on pr always
    • 6601f9e Bump black from 21.4b2 to 21.5b0
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.

    If all status checks pass Dependabot will automatically merge this pull request during working hours.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in the .dependabot/config.yml file in this repo:

    • Update frequency
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 5
  • Bump mock from 3.0.5 to 4.0.1

    Bump mock from 3.0.5 to 4.0.1

    Bumps mock from 3.0.5 to 4.0.1.

    Changelog

    Sourced from mock's changelog.

    4.0.1

    • Remove the universal marker from the wheel.

    4.0.0

    • No Changes from 4.0.0b1.

    4.0.0b1

    • The release is a fresh cut of cpython's 4a686504__. All changes to mock from that commit and before are included in this release along with the subsequent changes listed below.

      __ https://github.com/python/cpython/commit/4a686504eb2bbf69adf78077458508a7ba131667

    • Issue #37972: Subscripts to the unittest.mock.call objects now receive the same chaining mechanism as any other custom attributes, so that the following usage no longer raises a `TypeError`:

      call().foo().__getitem__('bar')

      Patch by blhsing

    • Issue #38839: Fix some unused functions in tests. Patch by Adam Johnson.

    • Issue #39485: Fix a bug in unittest.mock.create_autospec that would complain about the wrong number of arguments for custom descriptors defined in an extension module returning functions.

    • Issue #39082: Allow AsyncMock to correctly patch static/class methods

    • Issue #38093: Fixes AsyncMock so it doesn't crash when used with AsyncContextManagers or AsyncIterators.

    • Issue #38859: AsyncMock now returns StopAsyncIteration on the exaustion of a side_effects iterable. Since PEP-479 its Impossible to raise a StopIteration exception from a coroutine.

    • Issue #38163: Child mocks will now detect their type as either synchronous or asynchronous, asynchronous child mocks will be AsyncMocks and synchronous child mocks will be either MagicMock or Mock (depending on their parent type).

    • Issue #38473: Use signature from inner mock for autospecced methods attached with unittest.mock.attach_mock. Patch by Karthikeyan Singaravelan.

    • Issue #38136: Changes AsyncMock call count and await count to be two different counters. Now await count only counts when a coroutine has been awaited, not when it has been called, and vice-versa. Update the documentation around this.

    • Issue #37555: Fix NonCallableMock._call_matcher returning tuple instead of _Call object when self._spec_signature exists. Patch by Elizabeth Uselton

    • Issue #37251: Remove __code__ check in AsyncMock that incorrectly evaluated function specs as async objects but failed to evaluate classes with __await__ but no __code__ attribute defined as async objects.

    • Issue #38669: Raise TypeError when passing target as a string with unittest.mock.patch.object.

    • Issue #25597: Ensure, if wraps is supplied to unittest.mock.MagicMock, it is used to calculate return values for the magic methods instead of using the default return values. Patch by Karthikeyan Singaravelan.

    • Issue #38108: Any synchronous magic methods on an AsyncMock now return a MagicMock. Any asynchronous magic methods on a MagicMock now return an AsyncMock.

    • Issue #21478: Record calls to parent when autospecced object is attached to a mock using unittest.mock.attach_mock. Patch by Karthikeyan Singaravelan.

    • Issue #38857: AsyncMock fix for return values that are awaitable types. This also covers side_effect iterable values that happend to be awaitable, and wraps callables that return an awaitable type. Before these awaitables were being awaited instead of being returned as is.

    • Issue #38932: Mock fully resets child objects on reset_mock(). Patch by Vegard Stikbakke

    • Issue #37685: Fixed __eq__, __lt__ etc implementations in some classes. They now return NotImplemented for unsupported type of the other operand. This allows the other operand to play role (for example the equality comparison with ~unittest.mock.ANY will return True).

    • Issue #37212: unittest.mock.call now preserves the order of keyword arguments in repr output. Patch by Karthikeyan Singaravelan.

    • Issue #37828: Fix default mock name in unittest.mock.Mock.assert_called exceptions. Patch by Abraham Toriz Cruz.

    • Issue #36871: Improve error handling for the assert_has_calls and assert_has_awaits methods of mocks. Fixed a bug where any errors encountered while binding the expected calls to the mock's spec were silently swallowed, leading to misleading error output.

    • Issue #21600: Fix mock.patch.stopall to stop active patches that were created with mock.patch.dict.

    • Issue #38161: Removes _AwaitEvent from AsyncMock.

    • Issue #36871: Ensure method signature is used instead of constructor signature of a class while asserting mock object against method calls. Patch by Karthikeyan Singaravelan.

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.

    If all status checks pass Dependabot will automatically merge this pull request during working hours.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    • @dependabot badge me will comment on this PR with code to add a "Dependabot enabled" badge to your readme

    Additionally, you can set the following in the .dependabot/config.yml file in this repo:

    • Update frequency
    • Automerge options (never/patch/minor, and dev/runtime dependencies)
    • Out-of-range updates (receive only lockfile updates, if desired)
    • Security updates (receive only security updates, if desired)
    dependencies 
    opened by dependabot-preview[bot] 5
  • decode_responses is now being set to False by default - closes #14

    decode_responses is now being set to False by default - closes #14

    It's the same as the StrictRedis default value.
    

    Added ability to set decode_responses for redis client in redisdb parameter

    TODO:

    • [ ] - make this configurable in config
    opened by fizyk 5
  • TypeError invoking fixture when redis is not installed

    TypeError invoking fixture when redis is not installed

    What action do you want to perform

    Simply use the plugin.

    What are the results

    $ cat > test_pytest_redis.py
    __requires__ = ['pytest', 'pytest-redis==1.2.0']
    
    def test_fixture(redisdb):
        pass
    $ rwt -- -m pytest test_pytest_redis.py
    Collecting pytest-redis==1.2.0
      Using cached pytest_redis-1.2.0-py2.py3-none-any.whl
    Collecting redis (from pytest-redis==1.2.0)
      Using cached redis-2.10.5-py2.py3-none-any.whl
    Collecting pytest>=3.0.0 (from pytest-redis==1.2.0)
      Using cached pytest-3.0.7-py2.py3-none-any.whl
    Collecting mirakuru>=0.2 (from pytest-redis==1.2.0)
      Using cached mirakuru-0.8.2-py2.py3-none-any.whl
    Collecting port-for>=0.3.1 (from pytest-redis==1.2.0)
    Collecting py>=1.4.29 (from pytest>=3.0.0->pytest-redis==1.2.0)
      Using cached py-1.4.33-py2.py3-none-any.whl
    Collecting setuptools (from pytest>=3.0.0->pytest-redis==1.2.0)
      Using cached setuptools-34.3.3-py2.py3-none-any.whl
    Collecting psutil>=4.0.0 (from mirakuru>=0.2->pytest-redis==1.2.0)
    Collecting packaging>=16.8 (from setuptools->pytest>=3.0.0->pytest-redis==1.2.0)
      Using cached packaging-16.8-py2.py3-none-any.whl
    Collecting appdirs>=1.4.0 (from setuptools->pytest>=3.0.0->pytest-redis==1.2.0)
      Using cached appdirs-1.4.3-py2.py3-none-any.whl
    Collecting six>=1.6.0 (from setuptools->pytest>=3.0.0->pytest-redis==1.2.0)
      Using cached six-1.10.0-py2.py3-none-any.whl
    Collecting pyparsing (from packaging>=16.8->setuptools->pytest>=3.0.0->pytest-redis==1.2.0)
      Using cached pyparsing-2.2.0-py2.py3-none-any.whl
    Installing collected packages: redis, py, six, pyparsing, packaging, appdirs, setuptools, pytest, psutil, mirakuru, port-for, pytest-redis
    Successfully installed appdirs-1.4.3 mirakuru-0.8.2 packaging-16.8 port-for-0.3.1 psutil-5.2.1 py-1.4.33 pyparsing-2.2.0 pytest-3.0.7 pytest-redis-1.2.0 redis-2.10.5 setuptools-34.3.3 six-1.10.0
    ====================================== test session starts =======================================
    platform darwin -- Python 3.6.1, pytest-3.0.7, py-1.4.33, pluggy-0.4.0
    rootdir: /Users/jaraco, inifile:
    plugins: redis-1.2.0
    collected 1 items 
    
    test_pytest_redis.py E
    
    ============================================= ERRORS =============================================
    _________________________________ ERROR at setup of test_fixture _________________________________
    
    request = <SubRequest 'redisdb' for <Function 'test_fixture'>>
    
        @pytest.fixture
        def redisdb_factory(request):
            """
                Connection fixture for pytest-redis.
        
                #. Load required process fixture.
                #. Get redis module and config.
                #. Connect to redis.
                #. Flush database after tests.
        
                :param FixtureRequest request: fixture request object
                :rtype: redis.client.Redis
                :returns: Redis client
                """
    >       proc_fixture = request.getfixturevalue(process_fixture_name)
    
    /var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/rwt-o41ay1dl/pytest_redis/factories.py:195: 
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    /var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/rwt-o41ay1dl/pytest_redis/factories.py:156: in redis_proc_fixture
        cv_result = compare_version(redis_version, REQUIRED_VERSION)
    /var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/rwt-o41ay1dl/pytest_redis/factories.py:71: in compare_version
        return cmp_v(normalize(version1), normalize(version2))
    /var/folders/c6/v7hnmq453xb6p2dbz1gqc6rr0000gn/T/rwt-o41ay1dl/pytest_redis/factories.py:67: in normalize
        return [int(x) for x in re.sub(r'(\.0+)*$', '', v).split(".")]
    _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
    
    pattern = '(\\.0+)*$', repl = '', string = None, count = 0, flags = 0
    
        def sub(pattern, repl, string, count=0, flags=0):
            """Return the string obtained by replacing the leftmost
            non-overlapping occurrences of the pattern in string by the
            replacement repl.  repl can be either a string or a callable;
            if a string, backslash escapes in it are processed.  If it is
            a callable, it's passed the match object and must return
            a replacement string to be used."""
    >       return _compile(pattern, flags).sub(repl, string, count)
    E       TypeError: expected string or bytes-like object
    
    /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/re.py:191: TypeError
    ------------------------------------- Captured stderr setup --------------------------------------
    /bin/sh: /usr/bin/redis-server: No such file or directory
    ==================================== 1 error in 0.10 seconds =====================================
    

    What are the expected results

    1 test should pass or be skipped if redis isn't installed.

    bug 
    opened by jaraco 5
  • Make the NoopRedis fixture wait for the server to come up

    Make the NoopRedis fixture wait for the server to come up

    The redis_nooproc was a NOOP named tuple. The fixture is usually used when users control their own redis instance. It would be easy to assume, that the fixture would wait (block) for the server to be ready to connect to. This was not the case.

    Change the data structure to a class inheriting from TCPExecutor. The start up routine now wait's for the fixture to create a successful socket connection before the timout is met, otherwise fail.

    Note: This only uses AF_INET sockets (no IPv6 support).

    Fixes #388

    opened by romanofski 4
  • Bump redis from 4.3.4 to 4.4.0

    Bump redis from 4.3.4 to 4.4.0

    Bumps redis from 4.3.4 to 4.4.0.

    Release notes

    Sourced from redis's releases.

    Version 4.4.0

    Changes

    4.4.0rc4 release notes 4.4.0rc3 release notes 4.4.0rc2 release notes 4.4.0rc1 release notes

    🚀 New Features (since 4.4.0rc4)

    • Async clusters: Support creating locks inside async functions (#2471)

    🐛 Bug Fixes (since 4.4.0rc4)

    • Async: added 'blocking' argument to call lock method (#2454)
    • Added a replacement for the default cluster node in the event of failure. (#2463)
    • Fixed geosearch: Wrong number of arguments for geosearch command (#2464)

    🧰 Maintenance (since 4.4.0rc4)

    • Updating dev dependencies (#2475)
    • Removing deprecated LGTM (#2473)
    • Added an explicit index name in RediSearch example (#2466)
    • Adding connection step to bloom filter examples (#2478)

    Contributors (since 4.4.0rc4)

    We'd like to thank all the contributors who worked on this release!

    @​Sibuken, @​barshaul, @​chayim, @​dvora-h, @​nermiller, @​uglide and @​utkarshgupta137

    4.4.0rc4

    Changes

    🚀 New Features

    • CredentialsProvider class added to support password rotation (#2261)
    • Enable AsyncIO cluster mode lock (#2446)

    🐛 Bug Fixes

    • Failover handling improvements for RedisCluster and Async RedisCluster (#2377)
    • Improved response parsing options handler for special cases (#2302)

    Contributors

    We'd like to thank all the contributors who worked on this release!

    @​KMilhan, @​barshaul, @​dvora-h and @​fadida

    4.4.0rc3

    Changes

    ... (truncated)

    Commits

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 1
  • Bump pycodestyle from 2.9.1 to 2.10.0

    Bump pycodestyle from 2.9.1 to 2.10.0

    Bumps pycodestyle from 2.9.1 to 2.10.0.

    Changelog

    Sourced from pycodestyle's changelog.

    2.10.0 (2022-11-23)

    Changes:

    • E231: allow trailing comma inside 1-tuples in []. PR #1108.
    • W601, W602, W603, W604: removed (no longer relevant in python 3). PR #1111.
    • E741: also apply to lambdas. PR #1106.
    • E741: fix false positive for comparison operators. PR #1118.
    Commits
    • 1063db8 Merge pull request #1125 from PyCQA/2_10_0
    • 806bf5c Release 2.10.0
    • b388782 Merge pull request #1123 from PyCQA/fix-E741-again
    • 7498309 Merge pull request #1124 from PyCQA/py2-cruft
    • 798d620 fix ambiguous identifiers in lambda bodies inside braces
    • 956ab1f remove some leftover python 2 compat
    • c5308a7 Merge pull request #1122 from PyCQA/stop-E741-after-parameters
    • 56dac13 fix reporting of ambiguous identifier after parameter list
    • 6cac99d Merge pull request #1119 from PyCQA/pre-commit-ci-update-config
    • 1094676 [pre-commit.ci] pre-commit autoupdate
    • Additional commits viewable in compare view

    Dependabot compatibility score

    Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


    Dependabot commands and options

    You can trigger Dependabot actions by commenting on this PR:

    • @dependabot rebase will rebase this PR
    • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
    • @dependabot merge will merge this PR after your CI passes on it
    • @dependabot squash and merge will squash and merge this PR after your CI passes on it
    • @dependabot cancel merge will cancel a previously requested merge and block automerging
    • @dependabot reopen will reopen this PR if it is closed
    • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
    • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
    • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    dependencies python 
    opened by dependabot[bot] 0
  • Is redis server being configured to not support pub/sub?

    Is redis server being configured to not support pub/sub?

    What action do you want to perform

    i have a client that publishes data to a redis end point. the client works with the redis-server running but i am getting an error if its run with pytest-redis.

    What are the results

    Failed to publish data with error: An error was signalled by the server: wrong number of arguments for 'publish' command

    What are the expected results

    no errors should come up.

    opened by katetsu 1
  • Support for Sentinel?

    Support for Sentinel?

    What action do you want to perform

    Test an application that uses Sentinel to discover masters/slaves

    What are the results

    What are the expected results

    opened by lovetoburnswhen 2
  • Support for passing arbitrary command-line/configuration params to factories

    Support for passing arbitrary command-line/configuration params to factories

    What action do you want to perform

    I would like to test with a password protected (--require-pass) instance factories.redis_proc

    What are the results

    tests/conftest.py:13: in <module>
        redis_server = factories.redis_proc(**redis_kwargs, logsdir='/tmp')
    E   TypeError: redis_proc() got an unexpected keyword argument 'password'
    

    What are the expected results

    The kwargs to be passed on to redis-server

    enhancement help wanted 
    opened by lovetoburnswhen 1
Owner
Clearcode
Software house with a passion for technology. We specialize in building enterprise-grade adtech, martech and analytics platforms.
Clearcode
It helps to use fixtures in pytest.mark.parametrize

pytest-lazy-fixture Use your fixtures in @pytest.mark.parametrize. Installation pip install pytest-lazy-fixture Usage import pytest @pytest.fixture(p

Marsel Zaripov 299 Dec 24, 2022
A set of pytest fixtures to test Flask applications

pytest-flask An extension of pytest test runner which provides a set of useful tools to simplify testing and development of the Flask extensions and a

pytest-dev 354 Feb 17, 2021
pytest_pyramid provides basic fixtures for testing pyramid applications with pytest test suite

pytest_pyramid pytest_pyramid provides basic fixtures for testing pyramid applications with pytest test suite. By default, pytest_pyramid will create

Grzegorz Śliwiński 12 Dec 4, 2022
ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries.

ApiPy was created for api testing with Python pytest framework which has also requests, assertpy and pytest-html-reporter libraries. With this f

Mustafa 1 Jul 11, 2022
Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report

pytest-ui-automatic Playwright Python tool practice pytest pytest-bdd screen-play page-object allure cucumber-report How to run Run tests execute_test

moyu6027 11 Nov 8, 2022
pytest plugin providing a function to check if pytest is running.

pytest-is-running pytest plugin providing a function to check if pytest is running. Installation Install with: python -m pip install pytest-is-running

Adam Johnson 21 Nov 1, 2022
Pytest-typechecker - Pytest plugin to test how type checkers respond to code

pytest-typechecker this is a plugin for pytest that allows you to create tests t

vivax 2 Aug 20, 2022
Pytest-rich - Pytest + rich integration (proof of concept)

pytest-rich Leverage rich for richer test session output. This plugin is not pub

Bruno Oliveira 170 Dec 2, 2022
A pytest plugin to run an ansible collection's unit tests with pytest.

pytest-ansible-units An experimental pytest plugin to run an ansible collection's unit tests with pytest. Description pytest-ansible-units is a pytest

Community managed Ansible repositories 9 Dec 9, 2022
py.test fixture for benchmarking code

Overview docs tests package A pytest fixture for benchmarking code. It will group the tests into rounds that are calibrated to the chosen timer. See c

Ionel Cristian Mărieș 1k Jan 3, 2023
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.

The Mixer is a helper to generate instances of Django or SQLAlchemy models. It's useful for testing and fixture replacement. Fast and convenient test-

Kirill Klenov 871 Dec 25, 2022
Mixer -- Is a fixtures replacement. Supported Django, Flask, SqlAlchemy and custom python objects.

The Mixer is a helper to generate instances of Django or SQLAlchemy models. It's useful for testing and fixture replacement. Fast and convenient test-

Kirill Klenov 741 Feb 4, 2021
A test fixtures replacement for Python

factory_boy factory_boy is a fixtures replacement based on thoughtbot's factory_bot. As a fixtures replacement tool, it aims to replace static, hard t

FactoryBoy project 3k Jan 5, 2023
A test fixtures replacement for Python

factory_boy factory_boy is a fixtures replacement based on thoughtbot's factory_bot. As a fixtures replacement tool, it aims to replace static, hard t

FactoryBoy project 2.4k Feb 5, 2021
A test fixtures replacement for Python

factory_boy factory_boy is a fixtures replacement based on thoughtbot's factory_bot. As a fixtures replacement tool, it aims to replace static, hard t

FactoryBoy project 2.4k Feb 8, 2021
A command-line tool and Python library and Pytest plugin for automated testing of RESTful APIs, with a simple, concise and flexible YAML-based syntax

1.0 Release See here for details about breaking changes with the upcoming 1.0 release: https://github.com/taverntesting/tavern/issues/495 Easier API t

null 909 Dec 15, 2022
pytest splinter and selenium integration for anyone interested in browser interaction in tests

Splinter plugin for the pytest runner Install pytest-splinter pip install pytest-splinter Features The plugin provides a set of fixtures to use splin

pytest-dev 238 Nov 14, 2022
pytest plugin for distributed testing and loop-on-failures testing modes.

xdist: pytest distributed testing plugin The pytest-xdist plugin extends pytest with some unique test execution modes: test run parallelization: if yo

pytest-dev 1.1k Dec 30, 2022
:game_die: Pytest plugin to randomly order tests and control random.seed

pytest-randomly Pytest plugin to randomly order tests and control random.seed. Features All of these features are on by default but can be disabled wi

pytest-dev 471 Dec 30, 2022