Skip to content

Instantly share code, notes, and snippets.

@senaps

senaps/base.py Secret

Last active December 13, 2017 05:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save senaps/fbf05ca3d38d628f82d5301725a365c9 to your computer and use it in GitHub Desktop.
Save senaps/fbf05ca3d38d628f82d5301725a365c9 to your computer and use it in GitHub Desktop.
@pytest.fixture()
def app():
app = create_app(TestingConfig)
return app
==================================================================== test session starts =====================================================================
platform linux2 -- Python 2.7.5, pytest-3.3.1, py-1.5.2, pluggy-0.6.0
rootdir: /home/senaps/Projects/pers/flask-bare/code, inifile:
collected 4 items
tests/test_config.py ... [ 75%]
tests/test_main_bluprint.py E [100%]
=========================================================================== ERRORS ===========================================================================
___________________________________________________________ ERROR at setup of TestMain.test_index ____________________________________________________________
file /home/senaps/Projects/pers/flask-bare/code/tests/test_main_bluprint.py, line 8
def test_index(self, client):
E fixture 'client' not found
> available fixtures: app, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_xml_property, recwarn, tmpdir, tmpdir_factory
> use 'pytest --fixtures [testpath]' for help on them.
/home/senaps/Projects/pers/flask-bare/code/tests/test_main_bluprint.py:8
============================================================= 3 passed, 1 error in 0.02 seconds ==================================
class TestMain:
def test_index(self, client):
res = app.client.get(url_for('main.index'))
assert res.status_code == 200
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment