File: test_failure_cases.py

package info (click to toggle)
python-requirements-detector 1.3.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 472 kB
  • sloc: python: 2,096; makefile: 13; sh: 1
file content (21 lines) | stat: -rw-r--r-- 586 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
import os
from pathlib import Path

import pytest

from requirements_detector.detect import CouldNotParseRequirements, from_setup_py

_TEST_DIR = Path(__file__).parent / 'detection/syntax_error'

def test_setup_py_syntax_error():
    filepath = _TEST_DIR / "setup.py"
    with pytest.raises(CouldNotParseRequirements):
        from_setup_py(filepath)

def test_setup_py_multiline_string():
    filepath = _TEST_DIR / "setup_multiline_string.py"
    from_setup_py(filepath)

def test_regular_indentation():
    filepath = _TEST_DIR / "regular_indentation.py"
    from_setup_py(filepath)