File: test_open_file_detection.py

package info (click to toggle)
pytest-openfiles 0.6.0-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 180 kB
  • sloc: python: 96; makefile: 4
file content (22 lines) | stat: -rw-r--r-- 479 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
22
# Licensed under a 3-clause BSD style license - see LICENSE.rst
import os

import pytest

PKG_DATA_DIR = os.path.dirname(__file__)

fd = None


def test_open_file_detection():
    global fd
    fd = open(os.path.join(PKG_DATA_DIR, 'data/open_file_detection.txt'))

@pytest.mark.openfiles_ignore
def test_skip_open_file_detection():
    global fd
    fd = open(os.path.join(PKG_DATA_DIR, 'data/open_file_detection.txt'))

def teardown():
    if fd is not None:
        fd.close()