GitHub Access Token became invalid

It seems like the GitHub access token used for retrieving details about this repository from GitHub became invalid. This might prevent certain types of inspections from being run (in particular, everything related to pull requests).
Please ask an admin of your repository to re-new the access token on this website.
Completed
Push — master ( 47bd99...6fb05a )
by Alex
02:30
created

testapp()   A

Complexity

Conditions 3

Size

Total Lines 20

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 3
c 1
b 0
f 0
dl 0
loc 20
rs 9.4285
1
import pytest
2
3
from sugarloaf import create_app
4
from sugarloaf.models import db, User
5
6
7
@pytest.fixture()
8
def testapp(request):
9
    app = create_app('sugarloaf.settings.TestConfig')
10
    client = app.test_client()
11
12
    db.app = app
13
    db.create_all()
14
15
    if getattr(request.module, "create_user", True):
16
        admin = User('admin', 'supersafepassword')
17
        db.session.add(admin)
18
        db.session.commit()
19
20
    def teardown():
21
        db.session.remove()
22
        db.drop_all()
23
24
    request.addfinalizer(teardown)
25
26
    return client
27