File: conftest.py

package info (click to toggle)
getmac 0.9.5-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 976 kB
  • sloc: python: 2,133; sh: 84; makefile: 23
file content (21 lines) | stat: -rw-r--r-- 423 bytes parent folder | download
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 io
from os import path

import pytest

import getmac

getmac.getmac.DEBUG = 4


@pytest.fixture()
def get_sample():
    def _get_sample(sample_path):
        sdir = path.realpath(path.join(path.dirname(__file__), "samples"))
        with io.open(
            path.join(sdir, sample_path), "rt", newline="", encoding="utf-8"
        ) as f:
            return f.read()

    return _get_sample