From issues-reply at bitbucket.org Tue Nov 4 19:54:52 2014 From: issues-reply at bitbucket.org (Marc Schlaich) Date: Tue, 04 Nov 2014 18:54:52 -0000 Subject: [Pytest-commit] Issue #201: Tox installs alpha version of coverage (hpk42/tox) Message-ID: <20141104185452.21299.47668@app07.ash-private.bitbucket.org> New issue 201: Tox installs alpha version of coverage https://bitbucket.org/hpk42/tox/issue/201/tox-installs-alpha-version-of-coverage Marc Schlaich: `pip install coverage` installs current coverage version (3.7.1) while installing coverage via tox as `deps=coverage` installs coverage 4.0a1. From issues-reply at bitbucket.org Fri Nov 7 02:50:12 2014 From: issues-reply at bitbucket.org (Jason R. Coombs) Date: Fri, 07 Nov 2014 01:50:12 -0000 Subject: [Pytest-commit] Issue #628: UnicodeDecodeError (INTERNALERROR) when doctests contain Unicode (hpk42/pytest) Message-ID: <20141107015012.3749.4269@app11.ash-private.bitbucket.org> New issue 628: UnicodeDecodeError (INTERNALERROR) when doctests contain Unicode https://bitbucket.org/hpk42/pytest/issue/628/unicodedecodeerror-internalerror-when Jason R. Coombs: Consider this test: ``` def foo(): """ >>> name = '?' 'anything' """ ``` Note that isn't the letter 'c' but instead Cyrillic 's'. Save it as mod.py, then invoke `pytest --doctest-modules`. It will fail with this output: ``` > py.test --doctest-modules ?============================= test session starts ============================= platform win32 -- Python 3.4.2 -- py-1.4.26 -- pytest-2.6.4 collected 1 items mod.py INTERNALERROR> Traceback (most recent call last): INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\main.py", line 84, in wrap_session INTERNALERROR> doit(config, session) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\main.py", line 122, in _main INTERNALERROR> config.hook.pytest_runtestloop(session=session) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 413, in __call__ INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 424, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 315, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\main.py", line 142, in pytest_runtestloop INTERNALERROR> item.config.hook.pytest_runtest_protocol(item=item, nextitem=nextitem) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 413, in __call__ INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 424, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 315, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\runner.py", line 65, in pytest_runtest_protocol INTERNALERROR> runtestprotocol(item, nextitem=nextitem) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\runner.py", line 75, in runtestprotocol INTERNALERROR> reports.append(call_and_report(item, "call", log)) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\runner.py", line 111, in call_and_report INTERNALERROR> report = hook.pytest_runtest_makereport(item=item, call=call) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\main.py", line 167, in call_matching_hooks INTERNALERROR> return hookmethod.pcall(plugins, **kwargs) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 417, in pcall INTERNALERROR> return self._docall(methods, kwargs) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 424, in _docall INTERNALERROR> res = mc.execute() INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\core.py", line 315, in execute INTERNALERROR> res = method(**kwargs) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\runner.py", line 214, in pytest_runtest_makereport INTERNALERROR> longrepr = item.repr_failure(excinfo) INTERNALERROR> File "c:\python\lib\site-packages\pytest-2.6.4-py3.4.egg\_pytest\doctest.py", line 62, in repr_failure INTERNALERROR> filelines = py.path.local(filename).readlines(cr=0) INTERNALERROR> File "c:\python\lib\site-packages\py-1.4.26-py3.4.egg\py\_path\common.py", line 141, in readlines INTERNALERROR> content = self.read('rU') INTERNALERROR> File "c:\python\lib\site-packages\py-1.4.26-py3.4.egg\py\_path\common.py", line 135, in read INTERNALERROR> return f.read() INTERNALERROR> File "c:\python\lib\encodings\cp1252.py", line 23, in decode INTERNALERROR> return codecs.charmap_decode(input,self.errors,decoding_table)[0] INTERNALERROR> UnicodeDecodeError: 'charmap' codec can't decode byte 0x81 in position 36: character maps to ============================== in 0.30 seconds =============================== ``` From issues-reply at bitbucket.org Fri Nov 7 16:58:54 2014 From: issues-reply at bitbucket.org (Olga Botvinnik) Date: Fri, 07 Nov 2014 15:58:54 -0000 Subject: [Pytest-commit] Issue #629: py.test 2.6.4: selected test passes, but fails in whole test file (hpk42/pytest) Message-ID: <20141107155854.935.59823@app06.ash-private.bitbucket.org> New issue 629: py.test 2.6.4: selected test passes, but fails in whole test file https://bitbucket.org/hpk42/pytest/issue/629/pytest-264-selected-test-passes-but-fails Olga Botvinnik: Hello, I'm using py.test in a bioinformatics software package called flotilla. https://github.com/YeoLab/flotilla In the branch "py.test_bug", if I run `py.test flotilla/test/data_model/test_study.py`, the test `test_save` failes. But, if I run `py.test -k test_save flotilla/test/data_model/test_study.py`, the test passes. Here's the output: https://gist.github.com/olgabot/4a66e5144852ee7c306e Originally was using pytest 1.7.0, but I still get this inconsistency with 2.6.4. From issues-reply at bitbucket.org Mon Nov 10 19:17:48 2014 From: issues-reply at bitbucket.org (Matthias Hafner) Date: Mon, 10 Nov 2014 18:17:48 -0000 Subject: [Pytest-commit] Issue #630: XFail on function level ignored if xfail condition on class-level not met (hpk42/pytest) Message-ID: <20141110181748.4818.44080@app04.ash-private.bitbucket.org> New issue 630: XFail on function level ignored if xfail condition on class-level not met https://bitbucket.org/hpk42/pytest/issue/630/xfail-on-function-level-ignored-if-xfail Matthias Hafner: ``` #!python import pytest @pytest.mark.xfail('False') class TestBla: @pytest.mark.xfail(reason='bug') def test_bla(self): assert False ``` As the condition for the first xfail is False, the second xfail is wrongly ignored and the printout looks like: ``` #! ??? py.test test_bla.py ================================================================ test session starts ================================================================= platform linux2 -- Python 2.7.8 -- py-1.4.26 -- pytest-2.6.4 collected 1 items test_bla.py F ====================================================================== FAILURES ====================================================================== __________________________________________________________________ TestBla.test_bla __________________________________________________________________ self = @pytest.mark.xfail(reason='bug') def test_bla(self): > assert False E assert False test_bla.py:7: AssertionError ============================================================== short test summary info =============================================================== FAIL test_bla.py::TestBla::()::test_bla ============================================================== 1 failed in 0.01 seconds ============================================================== ``` From commits-noreply at bitbucket.org Tue Nov 11 09:55:03 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 11 Nov 2014 08:55:03 -0000 Subject: [Pytest-commit] commit/tox: 2 new changesets Message-ID: <20141111085503.27614.15578@app10.ash-private.bitbucket.org> 2 new commits in tox: https://bitbucket.org/hpk42/tox/commits/846b5eb6f8ac/ Changeset: 846b5eb6f8ac Branch: tomviner/typo-extra-in-docs-basictxt--1415645866375 User: tomviner Date: 2014-11-10 18:57:49+00:00 Summary: Typo: extra } in docs, basic.txt Affected #: 1 file diff -r 9d8f0d5319e77951c0542ece53c960dc3b2886e7 -r 846b5eb6f8ac6390f0dd9c61cd66dc9db746449f doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -76,7 +76,7 @@ deps = -rrequirements.txt -All installation commands are executed using ``{toxinidir}}`` +All installation commands are executed using ``{toxinidir}`` (the directory where ``tox.ini`` resides) as the current working directory. Therefore, the underlying ``pip`` installation will assume ``requirements.txt`` to exist at ``{toxinidir}/requirements.txt``. https://bitbucket.org/hpk42/tox/commits/cc3723fe6680/ Changeset: cc3723fe6680 User: hpk42 Date: 2014-11-11 08:54:59+00:00 Summary: Merged in tomviner/tox/tomviner/typo-extra-in-docs-basictxt--1415645866375 (pull request #126) Typo: extra } in docs, basic.txt Affected #: 1 file diff -r 9d8f0d5319e77951c0542ece53c960dc3b2886e7 -r cc3723fe6680f49ec11995d8df7f37b533fc5f33 doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -76,7 +76,7 @@ deps = -rrequirements.txt -All installation commands are executed using ``{toxinidir}}`` +All installation commands are executed using ``{toxinidir}`` (the directory where ``tox.ini`` resides) as the current working directory. Therefore, the underlying ``pip`` installation will assume ``requirements.txt`` to exist at ``{toxinidir}/requirements.txt``. Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Tue Nov 11 09:55:03 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Tue, 11 Nov 2014 08:55:03 -0000 Subject: [Pytest-commit] commit/tox: hpk42: Merged in tomviner/tox/tomviner/typo-extra-in-docs-basictxt--1415645866375 (pull request #126) Message-ID: <20141111085503.24877.93749@app14.ash-private.bitbucket.org> 1 new commit in tox: https://bitbucket.org/hpk42/tox/commits/cc3723fe6680/ Changeset: cc3723fe6680 User: hpk42 Date: 2014-11-11 08:54:59+00:00 Summary: Merged in tomviner/tox/tomviner/typo-extra-in-docs-basictxt--1415645866375 (pull request #126) Typo: extra } in docs, basic.txt Affected #: 1 file diff -r 9d8f0d5319e77951c0542ece53c960dc3b2886e7 -r cc3723fe6680f49ec11995d8df7f37b533fc5f33 doc/example/basic.txt --- a/doc/example/basic.txt +++ b/doc/example/basic.txt @@ -76,7 +76,7 @@ deps = -rrequirements.txt -All installation commands are executed using ``{toxinidir}}`` +All installation commands are executed using ``{toxinidir}`` (the directory where ``tox.ini`` resides) as the current working directory. Therefore, the underlying ``pip`` installation will assume ``requirements.txt`` to exist at ``{toxinidir}/requirements.txt``. Repository URL: https://bitbucket.org/hpk42/tox/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From issues-reply at bitbucket.org Tue Nov 11 15:48:06 2014 From: issues-reply at bitbucket.org (David Szotten) Date: Tue, 11 Nov 2014 14:48:06 -0000 Subject: [Pytest-commit] Issue #631: markers leaking (hpk42/pytest) Message-ID: <20141111144806.7391.42614@app12.ash-private.bitbucket.org> New issue 631: markers leaking https://bitbucket.org/hpk42/pytest/issue/631/markers-leaking David Szotten: it looks like using custom markers on subclasses, together with a fixture on the base class causes siblings to see each other's markers: ``` import pytest @pytest.fixture def common(): pass @pytest.fixture def checker(request): assert len(request.keywords.get('marker').args) == 1 @pytest.mark.usefixtures('common') class Parent(object): pass @pytest.mark.marker('arg1') class TestChild1(Parent): def test(self, checker): pass @pytest.mark.marker('arg2') class TestChild2(Parent): def test(self, checker): pass ``` ``` _________________________________________________ ERROR at setup of TestChild1.test _________________________________________________ request = > @pytest.fixture def checker(request): > assert len(request.keywords.get('marker').args) == 1 E assert 2 == 1 E + where 2 = len(('arg1', 'arg2')) E + where ('arg1', 'arg2') = .args E + where = >>('marker') E + where >> = >.get E + where > = >.keywords test_marker_bug.py:11: AssertionError ``` This might be related to #535 From issues-reply at bitbucket.org Mon Nov 17 11:53:39 2014 From: issues-reply at bitbucket.org (Colin Blackburn) Date: Mon, 17 Nov 2014 10:53:39 -0000 Subject: [Pytest-commit] Issue #632: Empty classname in junitxml for collection failure (hpk42/pytest) Message-ID: <20141117105339.21262.39624@app11.ash-private.bitbucket.org> New issue 632: Empty classname in junitxml for collection failure https://bitbucket.org/hpk42/pytest/issue/632/empty-classname-in-junitxml-for-collection Colin Blackburn: If there is a fail of some sort at the module or class level the tests are not collected. The failure as reported in the junitxml file has an empty classname. This causes problems in downstream reporting on Jenkins where a link to the error report cannot be correctly formed. Here are three example test files: ``` #!python # file name: test.integration.junit.test_class class TestClass(object): UL = [] UL._non_atrrib def testClass(self): assert True ``` ``` #!python # file name: test.integration.junit.test_module UL = [] UL._non_atrrib class TestModule(object): def testModule(self): assert True ``` ``` #!python # file name: test.integration.junit.test_method class TestMethod(object): def testMethod(self): UL = [] UL._non_atrrib assert True ``` which give this XML output: ``` #!xml test/integration/junit/test_class.py:5: in <module> class TestClass(object): test/integration/junit/test_class.py:8: in TestClass UL._non_atrrib E AttributeError: 'list' object has no attribute '_non_atrrib' test/integration/junit/test_module.py:6: in <module> UL._non_atrrib E AttributeError: 'list' object has no attribute '_non_atrrib' self = <test_method.TestMethod object at 0x10b61a6d0> def testMethod(self): UL = [] > UL._non_atrrib E AttributeError: 'list' object has no attribute '_non_atrrib' test/integration/junit/test_method.py:9: AttributeError ``` From issues-reply at bitbucket.org Fri Nov 21 20:18:49 2014 From: issues-reply at bitbucket.org (Alexandre Conrad) Date: Fri, 21 Nov 2014 19:18:49 -0000 Subject: [Pytest-commit] Issue #633: Disable configuration discovery / lookup (setup.cfg, pytest.ini, ...) (hpk42/pytest) Message-ID: <20141121191849.17008.41861@app07.ash-private.bitbucket.org> New issue 633: Disable configuration discovery / lookup (setup.cfg, pytest.ini, ...) https://bitbucket.org/hpk42/pytest/issue/633/disable-configuration-discovery-lookup Alexandre Conrad: I didn't find a way to disable configuration discovery, is this possible? I was thinking about something like this: ``` $ py.test --no-config-lookup ``` This would basically run a vanilla py.test as if no configuration files were found. If that sounds useful, I would imagine it being trivial to skip configuration discovery and would be willing to submit a PR. Pointers would help. From commits-noreply at bitbucket.org Mon Nov 24 09:41:57 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 24 Nov 2014 08:41:57 -0000 Subject: [Pytest-commit] commit/pytest: flub: Merged in techtonik/pytest/techtonik/readmerst-fix-link-to-pypi-1416719991514 (pull request #234) Message-ID: <20141124084157.4139.61927@app09.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/21cfbb03f359/ Changeset: 21cfbb03f359 User: flub Date: 2014-11-24 08:41:53+00:00 Summary: Merged in techtonik/pytest/techtonik/readmerst-fix-link-to-pypi-1416719991514 (pull request #234) README.rst fix link to PyPI Affected #: 1 file diff -r 85e3331b83cda6eee644c473b3b08f10016a3361 -r 21cfbb03f359d0b7a953c83cdca1296205006a61 README.rst --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ .. image:: https://drone.io/bitbucket.org/hpk42/pytest/status.png :target: https://drone.io/bitbucket.org/hpk42/pytest/latest -.. image:: https://pypip.in/v/pytest/badge.png - :target: https://crate.io/packages/pytest/ +.. image:: http://img.shields.io/pypi/v/pytest.svg + :target: https://pypi.python.org/pypi/pytest Documentation: http://pytest.org/latest/ Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Mon Nov 24 09:41:56 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 24 Nov 2014 08:41:56 -0000 Subject: [Pytest-commit] commit/pytest: 2 new changesets Message-ID: <20141124084156.10083.50668@app02.ash-private.bitbucket.org> 2 new commits in pytest: https://bitbucket.org/hpk42/pytest/commits/83294dff64bf/ Changeset: 83294dff64bf Branch: techtonik/readmerst-fix-link-to-pypi-1416719991514 User: techtonik Date: 2014-11-23 05:20:01+00:00 Summary: README.rst fix link to PyPI Affected #: 1 file diff -r 85e3331b83cda6eee644c473b3b08f10016a3361 -r 83294dff64bf15c033f7f11ec70307dd7561af28 README.rst --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ .. image:: https://drone.io/bitbucket.org/hpk42/pytest/status.png :target: https://drone.io/bitbucket.org/hpk42/pytest/latest -.. image:: https://pypip.in/v/pytest/badge.png - :target: https://crate.io/packages/pytest/ +.. image:: http://img.shields.io/pypi/v/pytest.svg + :target: https://pypi.python.org/pypi/pytest Documentation: http://pytest.org/latest/ https://bitbucket.org/hpk42/pytest/commits/21cfbb03f359/ Changeset: 21cfbb03f359 User: flub Date: 2014-11-24 08:41:53+00:00 Summary: Merged in techtonik/pytest/techtonik/readmerst-fix-link-to-pypi-1416719991514 (pull request #234) README.rst fix link to PyPI Affected #: 1 file diff -r 85e3331b83cda6eee644c473b3b08f10016a3361 -r 21cfbb03f359d0b7a953c83cdca1296205006a61 README.rst --- a/README.rst +++ b/README.rst @@ -1,7 +1,7 @@ .. image:: https://drone.io/bitbucket.org/hpk42/pytest/status.png :target: https://drone.io/bitbucket.org/hpk42/pytest/latest -.. image:: https://pypip.in/v/pytest/badge.png - :target: https://crate.io/packages/pytest/ +.. image:: http://img.shields.io/pypi/v/pytest.svg + :target: https://pypi.python.org/pypi/pytest Documentation: http://pytest.org/latest/ Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From commits-noreply at bitbucket.org Mon Nov 24 09:48:18 2014 From: commits-noreply at bitbucket.org (commits-noreply at bitbucket.org) Date: Mon, 24 Nov 2014 08:48:18 -0000 Subject: [Pytest-commit] commit/pytest: flub: Revert pypi badge again as the svg broke Message-ID: <20141124084818.7520.23557@app14.ash-private.bitbucket.org> 1 new commit in pytest: https://bitbucket.org/hpk42/pytest/commits/d91265465608/ Changeset: d91265465608 User: flub Date: 2014-11-24 08:48:09+00:00 Summary: Revert pypi badge again as the svg broke This reverts the pypi badge back to the pypip.in provided one because the shields.io one failed to render properly (and also wasn't on https). Affected #: 1 file diff -r 21cfbb03f359d0b7a953c83cdca1296205006a61 -r d91265465608bd3777ab0c882e5d68335d7472dd README.rst --- a/README.rst +++ b/README.rst @@ -1,6 +1,6 @@ .. image:: https://drone.io/bitbucket.org/hpk42/pytest/status.png :target: https://drone.io/bitbucket.org/hpk42/pytest/latest -.. image:: http://img.shields.io/pypi/v/pytest.svg +.. image:: https://pypip.in/v/pytest/badge.png :target: https://pypi.python.org/pypi/pytest Documentation: http://pytest.org/latest/ Repository URL: https://bitbucket.org/hpk42/pytest/ -- This is a commit notification from bitbucket.org. You are receiving this because you have the service enabled, addressing the recipient of this email. From issues-reply at bitbucket.org Thu Nov 27 22:45:21 2014 From: issues-reply at bitbucket.org (Nikolaus Rath) Date: Thu, 27 Nov 2014 21:45:21 -0000 Subject: [Pytest-commit] Issue #634: metafunc.parametrize overwrites scope (hpk42/pytest) Message-ID: <20141127214521.25161.39018@app01.ash-private.bitbucket.org> New issue 634: metafunc.parametrize overwrites scope https://bitbucket.org/hpk42/pytest/issue/634/metafuncparametrize-overwrites-scope Nikolaus Rath: According to http://pytest.org/latest/parametrize.html#the-metafunc-object, the `scope` parameter overrides the fixture scope *if specified*. But in practice, the fixture scope seems to be ignored even if no `scope` parameter is passed to `metafunc.parametrize`. Example: ``` #!python $ cat test_me.py #!/usr/bin/env python3 import pytest import logging log = logging.getLogger(__name__) @pytest.fixture(scope='module') def foo(request): print('preparing foo-%d' % request.param) return 'foo-%d' % request.param def test_one(foo): print(foo) def test_two(foo): print(foo) test_two.test_with = (2,3) def pytest_generate_tests(metafunc): params = list(range(4)) if not 'foo' in metafunc.fixturenames: return test_with = getattr(metafunc.function, 'test_with', None) if test_with: params = test_with metafunc.parametrize("foo", params, indirect=True) $ py.test-3 test_me.py -v -s ============================= test session starts ============================= platform linux -- Python 3.4.2 -- py-1.4.25 -- pytest-2.6.3 -- /usr/bin/python3 plugins: capturelog, ordering collected 6 items test_me.py::test_one[0] preparing foo-0 foo-0 PASSED test_me.py::test_one[1] preparing foo-1 foo-1 PASSED test_me.py::test_one[2] preparing foo-2 foo-2 PASSED test_me.py::test_one[3] preparing foo-3 foo-3 PASSED test_me.py::test_two[2] preparing foo-2 foo-2 PASSED test_me.py::test_two[3] preparing foo-3 foo-3 PASSED ========================== 6 passed in 0.01 seconds =========================== ``` Note how the fixture is called multiple times for the same parameter. From issues-reply at bitbucket.org Thu Nov 27 23:02:32 2014 From: issues-reply at bitbucket.org (Nikolaus Rath) Date: Thu, 27 Nov 2014 22:02:32 -0000 Subject: [Pytest-commit] Issue #635: Fixture scope is non-deterministic (hpk42/pytest) Message-ID: <20141127220232.23951.33887@app02.ash-private.bitbucket.org> New issue 635: Fixture scope is non-deterministic https://bitbucket.org/hpk42/pytest/issue/635/fixture-scope-is-non-deterministic Nikolaus Rath: Consider the attached test case. Both fixtures are defined with module scope, so they should be called just once for each parameter value. However, sometimes the "bar" fixture is called twice for the same parameter value. Example: ``` #! $ py.test-3 test_bug.py -s ============================= test session starts ============================= platform linux -- Python 3.4.2 -- py-1.4.25 -- pytest-2.6.3 plugins: capturelog, ordering collected 4 items test_bug.py preparing bar-1 preparing bar-1/foo-1 .preparing bar-2 preparing bar-2/foo-1 .preparing bar-2/foo-2 .preparing bar-1 preparing bar-1/foo-2 . ========================== 4 passed in 0.01 seconds =========================== $ py.test-3 test_bug.py -s ============================= test session starts ============================= platform linux -- Python 3.4.2 -- py-1.4.25 -- pytest-2.6.3 plugins: capturelog, ordering collected 4 items test_bug.py preparing bar-1 preparing bar-1/foo-1 .preparing bar-1/foo-2 .preparing bar-2 preparing bar-2/foo-2 .preparing bar-2/foo-1 . ========================== 4 passed in 0.01 seconds =========================== ``` I think the number of calls to a fixture should be determinstic and reproducible. Moreover, I think the second run (where "preparing bar-1" is printed only once) is correct.