File: test_crossplatlock.py

package info (click to toggle)
microsoft-authentication-extensions-for-python 1.3.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 248 kB
  • sloc: python: 1,062; sh: 24; makefile: 7
file content (19 lines) | stat: -rw-r--r-- 408 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import pytest
from msal_extensions import CrossPlatLock


def test_ensure_file_deleted():
    lockfile = './test_lock_1.txt'

    try:
        FileNotFoundError
    except NameError:
        FileNotFoundError = IOError

    print("Testing with {}".format(CrossPlatLock))
    with CrossPlatLock(lockfile):
        pass

    with pytest.raises(FileNotFoundError):
        with open(lockfile):
            pass