pytest-dev / pytest-repeat

pytest plugin for repeating test execution
https://pypi.python.org/pypi/pytest-repeat/
Other
172 stars 28 forks source link

0.9.1: pytest is failing #53

Closed kloczek closed 1 year ago

kloczek commented 3 years ago

I'm trying to package your module as rpm packag. So I'm using typical in such case build, install and test cycle used on building package from non-root account:

May I ask for help because few units are failing:

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-repeat-0.9.1-5.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-repeat-0.9.1-5.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -p no:randomly
=========================================================================== test session starts ============================================================================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
benchmark: 3.4.1 (defaults: timer=time.perf_counter disable_gc=False min_rounds=5 min_time=0.000005 max_time=1.0 calibration_precision=10 warmup=False warmup_iterations=100000)
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1
plugins: repeat-0.9.1, forked-1.3.0, shutil-1.7.0, virtualenv-1.7.0, expect-1.1.0, flake8-1.0.7, timeout-1.4.2, betamax-0.8.1, freezegun-0.4.2, aspectlib-1.5.2, toolbox-0.5, rerunfailures-9.1.1, requests-mock-1.9.3, cov-2.12.1, pyfakefs-4.5.0, flaky-3.7.0, benchmark-3.4.1, xdist-2.3.0, pylama-7.7.1, datadir-1.3.1, regressions-2.2.0, cases-3.6.3, xprocess-0.18.1, black-0.3.12, anyio-3.3.0, asyncio-0.15.1, trio-0.7.0, httpbin-1.0.0, subtests-0.5.0, isort-2.0.0, hypothesis-6.14.6, mock-3.6.1, profiling-1.7.0, Faker-8.12.1
collected 16 items

test_repeat.py .FFFFFFF.FFFFFF.                                                                                                                                      [100%]

================================================================================= FAILURES =================================================================================
________________________________________________________________________ TestRepeat.test_can_repeat ________________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a258b4a90>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_can_repeat0')>

    def test_can_repeat(self, testdir):
        testdir.makepyfile("""
            def test_repeat():
                pass
        """)
        result = testdir.runpytest('--count', '2')
>       result.stdout.fnmatch_lines(['*2 passed*'])
E       Failed: remains unmatched: '*2 passed*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:31: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_can_repeat0

___________________________________________________________ TestRepeat.test_mark_repeat_decorator_is_registered ____________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cf68d30>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_mark_repeat_decorator_is_registered0')>

    def test_mark_repeat_decorator_is_registered(self, testdir):
        result = testdir.runpytest('--markers')
>       result.stdout.fnmatch_lines([
            '@pytest.mark.repeat(n): run the given test function `n` times.'])
E       Failed: nomatch: '@pytest.mark.repeat(n): run the given test function `n` times.'
E           and: '@pytest.mark.filterwarnings(warning): add a warning filter to the given test. see https://docs.pytest.org/en/stable/warnings.html#pytest-mark-filterwarnings '
E           and: ''
E           and: '@pytest.mark.skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.'
E           and: ''
E           and: "@pytest.mark.skipif(condition, ..., *, reason=...): skip the given test function if any of the conditions evaluate to True. Example: skipif(sys.platform == 'win32') skips the test if we are on the win32 platform. See https://docs.pytest.org/en/stable/reference.html#pytest-mark-skipif"
E           and: ''
E           and: "@pytest.mark.xfail(condition, ..., *, reason=..., run=True, raises=None, strict=xfail_strict): mark the test function as an expected failure if any of the conditions evaluate to True. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See https://docs.pytest.org/en/stable/reference.html#pytest-mark-xfail"
E           and: ''
E           and: "@pytest.mark.parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/stable/parametrize.html for more info and examples."
E           and: ''
E           and: '@pytest.mark.usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/fixture.html#usefixtures '
E           and: ''
E           and: '@pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible.'
E           and: ''
E           and: '@pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible.'
E           and: ''
E       remains unmatched: '@pytest.mark.repeat(n): run the given test function `n` times.'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:36: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
@pytest.mark.filterwarnings(warning): add a warning filter to the given test. see https://docs.pytest.org/en/stable/warnings.html#pytest-mark-filterwarnings

@pytest.mark.skip(reason=None): skip the given test function with an optional reason. Example: skip(reason="no way of currently testing this") skips the test.

@pytest.mark.skipif(condition, ..., *, reason=...): skip the given test function if any of the conditions evaluate to True. Example: skipif(sys.platform == 'win32') skips the test if we are on the win32 platform. See https://docs.pytest.org/en/stable/reference.html#pytest-mark-skipif

@pytest.mark.xfail(condition, ..., *, reason=..., run=True, raises=None, strict=xfail_strict): mark the test function as an expected failure if any of the conditions evaluate to True. Optionally specify a reason for better reporting and run=False if you don't even want to execute the test function. If only specific exception(s) are expected, you can list them in raises, and if the test fails in other ways, it will be reported as a true failure. See https://docs.pytest.org/en/stable/reference.html#pytest-mark-xfail

@pytest.mark.parametrize(argnames, argvalues): call a test function multiple times passing in different arguments in turn. argvalues generally needs to be a list of values if argnames specifies only one name or a list of tuples of values if argnames specifies multiple names. Example: @parametrize('arg1', [1,2]) would lead to two calls of the decorated test function, one with arg1=1 and another with arg1=2.see https://docs.pytest.org/en/stable/parametrize.html for more info and examples.

@pytest.mark.usefixtures(fixturename1, fixturename2, ...): mark tests as needing all of the specified fixtures. see https://docs.pytest.org/en/stable/fixture.html#usefixtures

@pytest.mark.tryfirst: mark a hook implementation function such that the plugin machinery will try to call it first/as early as possible.

@pytest.mark.trylast: mark a hook implementation function such that the plugin machinery will try to call it last/as late as possible.

__________________________________________________________________ TestRepeat.test_mark_repeat_decorator ___________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cf54550>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_mark_repeat_decorator0')>

    def test_mark_repeat_decorator(self, testdir):
        testdir.makepyfile("""
            import pytest
            @pytest.mark.repeat(3)
            def test_mark_repeat_decorator():
                pass
        """)
        result = testdir.runpytest()
>       result.stdout.fnmatch_lines(['*3 passed*'])
E       Failed: nomatch: '*3 passed*'
E           and: '============================= test session starts =============================='
E           and: 'platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1'
E           and: 'rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_mark_repeat_decorator0'
E           and: 'collected 1 item'
E           and: ''
E           and: 'test_mark_repeat_decorator.py '
E           and: 'INTERNALERROR> Traceback (most recent call last):'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session'
E           and: 'INTERNALERROR>     session.exitstatus = doit(config, session) or 0'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 323, in _main'
E           and: 'INTERNALERROR>     config.hook.pytest_runtestloop(session=session)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__'
E           and: 'INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec'
E           and: 'INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 337, in traced_hookexec'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 52, in from_call'
E           and: 'INTERNALERROR>     result = func()'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 335, in <lambda>'
E           and: 'INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>'
E           and: 'INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall('
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall'
E           and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 348, in pytest_runtestloop'
E           and: 'INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__'
E           and: 'INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec'
E           and: 'INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 337, in traced_hookexec'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 52, in from_call'
E           and: 'INTERNALERROR>     result = func()'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 335, in <lambda>'
E           and: 'INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>'
E           and: 'INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall('
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall'
E           and: 'INTERNALERROR>     return outcome.get_result()'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result'
E           and: 'INTERNALERROR>     raise ex[1].with_traceback(ex[2])'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall'
E           and: 'INTERNALERROR>     res = hook_impl.function(*args)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 109, in pytest_runtest_protocol'
E           and: 'INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 120, in runtestprotocol'
E           and: 'INTERNALERROR>     rep = call_and_report(item, "setup", log)'
E           and: 'INTERNALERROR>   File "/usr/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 134, in call_and_report'
E           and: 'INTERNALERROR>     self._call_infos[item][when] = call'
E           and: 'INTERNALERROR> KeyError: <Function test_mark_repeat_decorator>'
E           and: ''
E           and: '============================ no tests ran in 0.01s ============================='
E       remains unmatched: '*3 passed*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:48: Failed
--------------------------------------------------------------------------- Captured stdout call ---------------------------------------------------------------------------
============================= test session starts ==============================
platform linux -- Python 3.8.11, pytest-6.2.4, py-1.10.0, pluggy-0.13.1
rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_mark_repeat_decorator0
collected 1 item

test_mark_repeat_decorator.py
INTERNALERROR> Traceback (most recent call last):
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 269, in wrap_session
INTERNALERROR>     session.exitstatus = doit(config, session) or 0
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 323, in _main
INTERNALERROR>     config.hook.pytest_runtestloop(session=session)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 337, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 52, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 335, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/main.py", line 348, in pytest_runtestloop
INTERNALERROR>     item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/hooks.py", line 286, in __call__
INTERNALERROR>     return self._hookexec(self, self.get_hookimpls(), kwargs)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 93, in _hookexec
INTERNALERROR>     return self._inner_hookexec(hook, methods, kwargs)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 337, in traced_hookexec
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 52, in from_call
INTERNALERROR>     result = func()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 335, in <lambda>
INTERNALERROR>     outcome = _Result.from_call(lambda: oldcall(hook, hook_impls, kwargs))
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/manager.py", line 84, in <lambda>
INTERNALERROR>     self._inner_hookexec = lambda hook, methods, kwargs: hook.multicall(
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 208, in _multicall
INTERNALERROR>     return outcome.get_result()
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 80, in get_result
INTERNALERROR>     raise ex[1].with_traceback(ex[2])
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/pluggy/callers.py", line 187, in _multicall
INTERNALERROR>     res = hook_impl.function(*args)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 109, in pytest_runtest_protocol
INTERNALERROR>     runtestprotocol(item, nextitem=nextitem)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/_pytest/runner.py", line 120, in runtestprotocol
INTERNALERROR>     rep = call_and_report(item, "setup", log)
INTERNALERROR>   File "/usr/lib/python3.8/site-packages/flaky/flaky_pytest_plugin.py", line 134, in call_and_report
INTERNALERROR>     self._call_infos[item][when] = call
INTERNALERROR> KeyError: <Function test_mark_repeat_decorator>

============================ no tests ran in 0.01s =============================
____________________________________________________________ TestRepeat.test_mark_repeat_decorator_repeat_once _____________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1ce9c220>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_mark_repeat_decorator_repeat_once0')>

    def test_mark_repeat_decorator_repeat_once(self, testdir):
        testdir.makepyfile("""
            import pytest
            @pytest.mark.repeat(1)
            def test_mark_repeat_decorator_repeat_once():
                pass
        """)
        result = testdir.runpytest('--count', '10')
>       result.stdout.fnmatch_lines(['*1 passed*'])
E       Failed: remains unmatched: '*1 passed*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:59: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_mark_repeat_decorator_repeat_once0

_______________________________________________________________________ TestRepeat.test_parametrize ________________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1ce9cc70>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_parametrize0')>

    def test_parametrize(self, testdir):
        testdir.makepyfile("""
            import pytest
            @pytest.mark.parametrize('x', ['a', 'b', 'c'])
            def test_repeat(x):
                pass
        """)
        result = testdir.runpytest('-v', '--count', '2')
>       result.stdout.fnmatch_lines([
            '*test_parametrize.py::test_repeat[[]a-1-2[]] PASSED*',
            '*test_parametrize.py::test_repeat[[]a-2-2[]] PASSED*',
            '*test_parametrize.py::test_repeat[[]b-1-2[]] PASSED*',
            '*test_parametrize.py::test_repeat[[]b-2-2[]] PASSED*',
            '*test_parametrize.py::test_repeat[[]c-1-2[]] PASSED*',
            '*test_parametrize.py::test_repeat[[]c-2-2[]] PASSED*',
            '*6 passed*',
        ])
E       Failed: remains unmatched: '*test_parametrize.py::test_repeat[[]a-1-2[]] PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:70: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_parametrize0

___________________________________________________________________ TestRepeat.test_parametrized_fixture ___________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cd81bb0>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_parametrized_fixture0')>

    def test_parametrized_fixture(self, testdir):
        testdir.makepyfile("""
            import pytest
            @pytest.fixture(params=['a', 'b', 'c'])
            def parametrized_fixture(request):
                return request.param

            def test_repeat(parametrized_fixture):
                pass
        """)
        result = testdir.runpytest('--count', '2')
>       result.stdout.fnmatch_lines(['*6 passed*'])
E       Failed: remains unmatched: '*6 passed*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:92: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_parametrized_fixture0

_______________________________________________________________________ TestRepeat.test_step_number ________________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cd76280>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_step_number0')>

    def test_step_number(self, testdir):
        testdir.makepyfile("""
            import pytest
            expected_steps = iter(range(5))
            def test_repeat(__pytest_repeat_step_number):
                assert next(expected_steps) == __pytest_repeat_step_number
                if __pytest_repeat_step_number == 4:
                    assert not list(expected_steps)
        """)
        result = testdir.runpytest('-v', '--count', '5')
>       result.stdout.fnmatch_lines([
            '*test_step_number.py::test_repeat[[]1-5[]] PASSED*',
            '*test_step_number.py::test_repeat[[]2-5[]] PASSED*',
            '*test_step_number.py::test_repeat[[]3-5[]] PASSED*',
            '*test_step_number.py::test_repeat[[]4-5[]] PASSED*',
            '*test_step_number.py::test_repeat[[]5-5[]] PASSED*',
            '*5 passed*',
        ])
E       Failed: remains unmatched: '*test_step_number.py::test_repeat[[]1-5[]] PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:105: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_step_number0

______________________________________________________________________ TestRepeat.test_unittest_test _______________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1ccf7190>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_unittest_test0')>

    def test_unittest_test(self, testdir):
        testdir.makepyfile("""
            from unittest import TestCase

            class ClassStyleTest(TestCase):
                def test_this(self):
                    assert 1
        """)
        result = testdir.runpytest('-v', '--count', '2')
>       result.stdout.fnmatch_lines([
            '*test_unittest_test.py::ClassStyleTest::test_this PASSED*',
            '*1 passed*',
        ])
E       Failed: remains unmatched: '*test_unittest_test.py::ClassStyleTest::test_this PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:132: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_unittest_test0

__________________________________________________________________ TestRepeat.test_scope[session-lines0] ___________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cc88be0>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_scope0')>, scope = 'session'
lines = ['*test_1.py::test_repeat1[[]1-2[]] PASSED*', '*test_1.py::test_repeat2[[]1-2[]] PASSED*', '*test_2.py::test_repeat3[[...*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*', '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*', ...]

    @pytest.mark.parametrize(['scope', 'lines'], [
        ('session', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('module', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('class', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('function', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
    ])
    def test_scope(self, testdir, scope, lines):
        testdir.makepyfile(test_1="""
            def test_repeat1():
                pass

            def test_repeat2():
                pass
        """)
        testdir.makepyfile(test_2="""
            def test_repeat3():
                pass

            def test_repeat4():
                pass
        """)
        testdir.makepyfile(test_3="""
            class TestRepeat1(object):
                def test_repeat5(self):
                    pass
                def test_repeat6(self):
                    pass
            class TestRepeat2(object):
                def test_repeat7(self):
                    pass
                def test_repeat8(self):
                    pass
        """)
        result = testdir.runpytest('-v', '--count', '2', '--repeat-scope',
                                   scope)
>       result.stdout.fnmatch_lines(lines)
E       Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:244: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count --repeat-scope session
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_scope0

___________________________________________________________________ TestRepeat.test_scope[module-lines1] ___________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1ccf0c70>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_scope1')>, scope = 'module'
lines = ['*test_1.py::test_repeat1[[]1-2[]] PASSED*', '*test_1.py::test_repeat2[[]1-2[]] PASSED*', '*test_1.py::test_repeat1[[...peat2[[]2-2[]] PASSED*', '*test_2.py::test_repeat3[[]1-2[]] PASSED*', '*test_2.py::test_repeat4[[]1-2[]] PASSED*', ...]

    @pytest.mark.parametrize(['scope', 'lines'], [
        ('session', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('module', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('class', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('function', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
    ])
    def test_scope(self, testdir, scope, lines):
        testdir.makepyfile(test_1="""
            def test_repeat1():
                pass

            def test_repeat2():
                pass
        """)
        testdir.makepyfile(test_2="""
            def test_repeat3():
                pass

            def test_repeat4():
                pass
        """)
        testdir.makepyfile(test_3="""
            class TestRepeat1(object):
                def test_repeat5(self):
                    pass
                def test_repeat6(self):
                    pass
            class TestRepeat2(object):
                def test_repeat7(self):
                    pass
                def test_repeat8(self):
                    pass
        """)
        result = testdir.runpytest('-v', '--count', '2', '--repeat-scope',
                                   scope)
>       result.stdout.fnmatch_lines(lines)
E       Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:244: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count --repeat-scope module
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_scope1

___________________________________________________________________ TestRepeat.test_scope[class-lines2] ____________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cbf77f0>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_scope2')>, scope = 'class'
lines = ['*test_1.py::test_repeat1[[]1-2[]] PASSED*', '*test_1.py::test_repeat2[[]1-2[]] PASSED*', '*test_1.py::test_repeat1[[...peat2[[]2-2[]] PASSED*', '*test_2.py::test_repeat3[[]1-2[]] PASSED*', '*test_2.py::test_repeat4[[]1-2[]] PASSED*', ...]

    @pytest.mark.parametrize(['scope', 'lines'], [
        ('session', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('module', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('class', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('function', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
    ])
    def test_scope(self, testdir, scope, lines):
        testdir.makepyfile(test_1="""
            def test_repeat1():
                pass

            def test_repeat2():
                pass
        """)
        testdir.makepyfile(test_2="""
            def test_repeat3():
                pass

            def test_repeat4():
                pass
        """)
        testdir.makepyfile(test_3="""
            class TestRepeat1(object):
                def test_repeat5(self):
                    pass
                def test_repeat6(self):
                    pass
            class TestRepeat2(object):
                def test_repeat7(self):
                    pass
                def test_repeat8(self):
                    pass
        """)
        result = testdir.runpytest('-v', '--count', '2', '--repeat-scope',
                                   scope)
>       result.stdout.fnmatch_lines(lines)
E       Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:244: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count --repeat-scope class
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_scope2

__________________________________________________________________ TestRepeat.test_scope[function-lines3] __________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cc38cd0>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_scope3')>, scope = 'function'
lines = ['*test_1.py::test_repeat1[[]1-2[]] PASSED*', '*test_1.py::test_repeat1[[]2-2[]] PASSED*', '*test_1.py::test_repeat2[[...peat2[[]2-2[]] PASSED*', '*test_2.py::test_repeat3[[]1-2[]] PASSED*', '*test_2.py::test_repeat3[[]2-2[]] PASSED*', ...]

    @pytest.mark.parametrize(['scope', 'lines'], [
        ('session', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('module', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('class', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
        ('function', [
            '*test_1.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_1.py::test_repeat2[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat3[[]2-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]1-2[]] PASSED*',
            '*test_2.py::test_repeat4[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat5[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat1::test_repeat6[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat7[[]2-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]1-2[]] PASSED*',
            '*test_3.py::TestRepeat2::test_repeat8[[]2-2[]] PASSED*',
            '*16 passed*',
        ]),
    ])
    def test_scope(self, testdir, scope, lines):
        testdir.makepyfile(test_1="""
            def test_repeat1():
                pass

            def test_repeat2():
                pass
        """)
        testdir.makepyfile(test_2="""
            def test_repeat3():
                pass

            def test_repeat4():
                pass
        """)
        testdir.makepyfile(test_3="""
            class TestRepeat1(object):
                def test_repeat5(self):
                    pass
                def test_repeat6(self):
                    pass
            class TestRepeat2(object):
                def test_repeat7(self):
                    pass
                def test_repeat8(self):
                    pass
        """)
        result = testdir.runpytest('-v', '--count', '2', '--repeat-scope',
                                   scope)
>       result.stdout.fnmatch_lines(lines)
E       Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:244: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count --repeat-scope function
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_scope3

______________________________________________________________________ TestRepeat.test_omitted_scope _______________________________________________________________________

self = <test_repeat.TestRepeat object at 0x7f4a1cb8b400>, testdir = <Testdir local('/tmp/pytest-of-tkloczko/pytest-125/test_omitted_scope0')>

    def test_omitted_scope(self, testdir):
        testdir.makepyfile("""
            def test_repeat1():
                pass

            def test_repeat2():
                pass
        """)
        result = testdir.runpytest('-v', '--count', '2')
>       result.stdout.fnmatch_lines([
            '*test_omitted_scope.py::test_repeat1[[]1-2[]] PASSED*',
            '*test_omitted_scope.py::test_repeat1[[]2-2[]] PASSED*',
            '*test_omitted_scope.py::test_repeat2[[]1-2[]] PASSED*',
            '*test_omitted_scope.py::test_repeat2[[]2-2[]] PASSED*',
            '*4 passed*',
        ])
E       Failed: remains unmatched: '*test_omitted_scope.py::test_repeat1[[]1-2[]] PASSED*'

/home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.1/test_repeat.py:256: Failed
--------------------------------------------------------------------------- Captured stderr call ---------------------------------------------------------------------------
ERROR: usage: pytest [options] [file_or_dir] [file_or_dir] [...]
pytest: error: unrecognized arguments: --count
  inifile: None
  rootdir: /tmp/pytest-of-tkloczko/pytest-125/test_omitted_scope0

========================================================================= short test summary info ==========================================================================
FAILED test_repeat.py::TestRepeat::test_can_repeat - Failed: remains unmatched: '*2 passed*'
FAILED test_repeat.py::TestRepeat::test_mark_repeat_decorator_is_registered - Failed: nomatch: '@pytest.mark.repeat(n): run the given test function `n` times.'
FAILED test_repeat.py::TestRepeat::test_mark_repeat_decorator - Failed: nomatch: '*3 passed*'
FAILED test_repeat.py::TestRepeat::test_mark_repeat_decorator_repeat_once - Failed: remains unmatched: '*1 passed*'
FAILED test_repeat.py::TestRepeat::test_parametrize - Failed: remains unmatched: '*test_parametrize.py::test_repeat[[]a-1-2[]] PASSED*'
FAILED test_repeat.py::TestRepeat::test_parametrized_fixture - Failed: remains unmatched: '*6 passed*'
FAILED test_repeat.py::TestRepeat::test_step_number - Failed: remains unmatched: '*test_step_number.py::test_repeat[[]1-5[]] PASSED*'
FAILED test_repeat.py::TestRepeat::test_unittest_test - Failed: remains unmatched: '*test_unittest_test.py::ClassStyleTest::test_this PASSED*'
FAILED test_repeat.py::TestRepeat::test_scope[session-lines0] - Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'
FAILED test_repeat.py::TestRepeat::test_scope[module-lines1] - Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'
FAILED test_repeat.py::TestRepeat::test_scope[class-lines2] - Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'
FAILED test_repeat.py::TestRepeat::test_scope[function-lines3] - Failed: remains unmatched: '*test_1.py::test_repeat1[[]1-2[]] PASSED*'
FAILED test_repeat.py::TestRepeat::test_omitted_scope - Failed: remains unmatched: '*test_omitted_scope.py::test_repeat1[[]1-2[]] PASSED*'
======================================================================= 13 failed, 3 passed in 1.51s =======================================================================
pytest-xprocess reminder::Be sure to terminate the started process by running 'pytest --xkill' if you have not explicitly done so in your fixture with 'xprocess.getinfo(<process_name>).terminate()'.
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1997f056-b7e7-4f45-8b03-fcd91c83b1b6/test_safe_get_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_get_no_perms0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1997f056-b7e7-4f45-8b03-fcd91c83b1b6/test_safe_delete_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_delete_no_perms0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1997f056-b7e7-4f45-8b03-fcd91c83b1b6/test_safe_set_no_perms0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_safe_set_no_perms0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1997f056-b7e7-4f45-8b03-fcd91c83b1b6/test_rmtree_errorhandler_rerai0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_rerai0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1997f056-b7e7-4f45-8b03-fcd91c83b1b6/test_rmtree_errorhandler_reado0
<class 'OSError'>: [Errno 39] Directory not empty: 'test_rmtree_errorhandler_reado0'
  warnings.warn(
/usr/lib/python3.8/site-packages/_pytest/pathlib.py:80: PytestWarning: (rm_rf) error removing /tmp/pytest-of-tkloczko/garbage-1997f056-b7e7-4f45-8b03-fcd91c83b1b6
<class 'OSError'>: [Errno 39] Directory not empty: '/tmp/pytest-of-tkloczko/garbage-1997f056-b7e7-4f45-8b03-fcd91c83b1b6'
  warnings.warn(
okken commented 1 year ago

As this is 2 years old, and our tests are passing, I’m assuming it’s not a problem anymore

kloczek commented 1 year ago

Yep that is correct. Now pytest is clean,

+ PYTHONPATH=/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-repeat-0.9.2-2.fc35.x86_64/usr/lib64/python3.8/site-packages:/home/tkloczko/rpmbuild/BUILDROOT/python-pytest-repeat-0.9.2-2.fc35.x86_64/usr/lib/python3.8/site-packages
+ /usr/bin/pytest -ra -m 'not network'
============================= test session starts ==============================
platform linux -- Python 3.8.18, pytest-7.4.2, pluggy-1.3.0
rootdir: /home/tkloczko/rpmbuild/BUILD/pytest-repeat-0.9.2
plugins: repeat-0.9.2
collected 16 items

test_repeat.py ................                                          [100%]

============================== 16 passed in 0.92s ==============================