Debian Codegraph @

test/conftest.py

raw symbols ◀ ▶
Source reconstructed at patch state 0 of 1 — not the installed (fully patched) source.
1 Debian patch touch this file
1 # -*- coding: utf-8 -*-
2 import os
3 import os.path
4
5 import pytest
6
7 # Statically look for all the files.
8 curdir = os.path.split(os.path.dirname(__file__))[0]
9 TEST_DATA_DIR = os.path.join(curdir, 'libbrotli', 'tests', 'testdata')
10 simple_test_files = [
11 os.path.join(TEST_DATA_DIR, p) for p in os.listdir(TEST_DATA_DIR)
12 ]
13 compressed_simple_test_files = set(
14 f for f in simple_test_files if f.endswith('.compressed')
15 )
16
17
18 @pytest.fixture(params=compressed_simple_test_files)
19 def simple_compressed_file(request):
20 """
21 Returns a two-tuple: (uncompressed_file, compressed_file), from the Brotli
22 test fixtures.
23 """
24 file = request.param
25 return (file[:-len('.compressed')], file)
26
27
28 @pytest.fixture(scope='session')
29 def one_compressed_file():
30 return os.path.join(TEST_DATA_DIR, 'alice29.txt')