Skip to content

Instantly share code, notes, and snippets.

@aequitas
Created September 21, 2015 12:46
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Save aequitas/e36d3c8e901aba30ea22 to your computer and use it in GitHub Desktop.
pytest-flask pytest-2.8 bug
virtualenv env
env/bin/pip install pytest
env/bin/py.test test.py --doctest-modules
env/bin/pip install pytest-flask
env/bin/py.test test.py --doctest-modules
~/Temp/pytest-flask-bug❯ virtualenv env (env) Python 3.4.1
Using base prefix '/Library/Frameworks/Python.framework/Versions/3.4'
New python executable in env/bin/python3.4
Also creating executable in env/bin/python
Please make sure you remove any previous custom paths from your /Users/johanbloemberg/.pydistutils.cfg file.
Installing setuptools, pip, wheel...done.
~/Temp/pytest-flask-bug❯ env/bin/pip install pytest (env) Python 3.4.1
You are using pip version 7.0.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pytest
Using cached https://py-ames.repo.avira.net/root/pypi/+f/8b6/92e5940b5afb5/pytest-2.8.0-py2.py3-none-any.whl
Collecting py>=1.4.29 (from pytest)
Using cached https://py-ames.repo.avira.net/root/pypi/+f/d0f/aee5774a42313/py-1.4.30-py2.py3-none-any.whl
Installing collected packages: py, pytest
Successfully installed py-1.4.30 pytest-2.8.0
~/Temp/pytest-flask-bug❯ env/bin/py.test test.py --doctest-modules (env) Python 3.4.1
==================================================================================================== test session starts ====================================================================================================
platform darwin -- Python 3.4.1, pytest-2.8.0, py-1.4.30, pluggy-0.3.1
rootdir: /Users/johanbloemberg/Temp/pytest-flask-bug, inifile:
collected 1 items
test.py .
================================================================================================= 1 passed in 0.02 seconds ==================================================================================================
~/Temp/pytest-flask-bug❯ env/bin/pip install pytest-flask (env) Python 3.4.1
You are using pip version 7.0.0, however version 7.1.2 is available.
You should consider upgrading via the 'pip install --upgrade pip' command.
Collecting pytest-flask
Using cached https://py-ames.repo.avira.net/root/pypi/+f/9a8/2d552265b09ca/pytest_flask-0.10.0-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): pytest>=2.4 in ./env/lib/python3.4/site-packages (from pytest-flask)
Collecting Flask (from pytest-flask)
Collecting Werkzeug>=0.7 (from pytest-flask)
Using cached https://py-ames.repo.avira.net/root/pypi/+f/401/7a2ed262cfa97/Werkzeug-0.10.4-py2.py3-none-any.whl
Requirement already satisfied (use --upgrade to upgrade): py>=1.4.29 in ./env/lib/python3.4/site-packages (from pytest>=2.4->pytest-flask)
Collecting Jinja2>=2.4 (from Flask->pytest-flask)
Using cached https://py-ames.repo.avira.net/root/pypi/+f/75a/cb6f1abfc46ed/Jinja2-2.8-py2.py3-none-any.whl
Collecting itsdangerous>=0.21 (from Flask->pytest-flask)
Collecting MarkupSafe (from Jinja2>=2.4->Flask->pytest-flask)
Installing collected packages: Werkzeug, MarkupSafe, Jinja2, itsdangerous, Flask, pytest-flask
Successfully installed Flask-0.10.1 Jinja2-2.8 MarkupSafe-0.23 Werkzeug-0.10.4 itsdangerous-0.24 pytest-flask-0.10.0
~/Temp/pytest-flask-bug❯ env/bin/py.test test.py --doctest-modules (env) Python 3.4.1
==================================================================================================== test session starts ====================================================================================================
platform darwin -- Python 3.4.1, pytest-2.8.0, py-1.4.30, pluggy-0.3.1
rootdir: /Users/johanbloemberg/Temp/pytest-flask-bug, inifile:
plugins: flask-0.10.0
collected 1 items
test.py .ETraceback (most recent call last):
File "env/bin/py.test", line 11, in <module>
sys.exit(main())
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/config.py", line 48, in main
return config.hook.pytest_cmdline_main(config=config)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
_MultiCall(methods, kwargs, hook.spec_opts).execute()
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
res = hook_impl.function(*args)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/main.py", line 115, in pytest_cmdline_main
return wrap_session(config, _main)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/main.py", line 110, in wrap_session
exitstatus=session.exitstatus)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 724, in __call__
return self._hookexec(self, self._nonwrappers + self._wrappers, kwargs)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 338, in _hookexec
return self._inner_hookexec(hook, methods, kwargs)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 333, in <lambda>
_MultiCall(methods, kwargs, hook.spec_opts).execute()
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 595, in execute
return _wrapped_call(hook_impl.function(*args), self.execute)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 249, in _wrapped_call
wrap_controller.send(call_outcome)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/terminal.py", line 361, in pytest_sessionfinish
outcome.get_result()
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 278, in get_result
raise ex[1].with_traceback(ex[2])
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 264, in __init__
self.result = func()
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/vendored_packages/pluggy.py", line 596, in execute
res = hook_impl.function(*args)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/runner.py", line 55, in pytest_sessionfinish
session._setupstate.teardown_all()
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/runner.py", line 375, in teardown_all
self._pop_and_teardown()
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/runner.py", line 348, in _pop_and_teardown
self._teardown_with_finalization(colitem)
File "/Users/johanbloemberg/Temp/pytest-flask-bug/env/lib/python3.4/site-packages/_pytest/runner.py", line 371, in _teardown_with_finalization
or isinstance(colitem, tuple)
AssertionError: assert (<DoctestModule 'test.py'> is None or <DoctestModule 'test.py'> in [<Session 'pytest-flask-bug'>] or isinstance(<DoctestModule 'test.py'>, tuple))
+ where [<Session 'pytest-flask-bug'>] = [<Session 'pytest-flask-bug'>]
+ where [<Session 'pytest-flask-bug'>] = <_pytest.runner.SetupState object at 0x103914ac8>.stack
def test_test():
assert True
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment