File: scrap_fixt.py

package info (click to toggle)
pyquery 1.4.3-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 412 kB
  • sloc: python: 2,768; makefile: 128; xml: 9; sh: 4
file content (21 lines) | stat: -rw-r--r-- 500 bytes parent folder | download | duplicates (4)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
# -*- coding: utf-8 -*-
import os
import sys
sys.path.insert(0, os.path.dirname(os.path.dirname(__file__)))
from webtest import http
from tests.apps import input_app


def setup_test(test):
    server = http.StopableWSGIServer.create(input_app)
    server.wait()
    test.globs.update(
        server=server,
        your_url=server.application_url.rstrip('/') + '/html',
    )
setup_test.__test__ = False


def teardown_test(test):
    test.globs['server'].shutdown()
teardown_test.__test__ = False