class documentation

class TestReadAttr: (source)

View In Hierarchy

Undocumented

Method test_import_order Sometimes the import machinery will import the parent package of a nested module, which triggers side-effects and might create problems (see issue #3176)
Method test_read_annotated_attr Undocumented
Method test_read_attr Undocumented
Method test_read_attr_encoding_cookie Undocumented
def test_import_order(self, tmp_path): (source)

Sometimes the import machinery will import the parent package of a nested module, which triggers side-effects and might create problems (see issue #3176) ``read_attr`` should bypass these limitations by resolving modules statically (via ast.literal_eval).

@pytest.mark.parametrize('example', ['VERSION: str\nVERSION = \'0.1.1\'\nraise SystemExit(1)\n', 'VERSION: str = \'0.1.1\'\nraise SystemExit(1)\n'])
def test_read_annotated_attr(self, tmp_path, example): (source)

Undocumented

def test_read_attr(self, tmp_path, monkeypatch): (source)

Undocumented

@pytest.mark.parametrize('example', [b'__version__ = '\xc3\xa9'\nraise SystemExit(1)\n', b'# -*- coding: utf-8 -*-\n__version__ = '\xc3\xa9'\nraise SystemExit(1)\n', b'# -*- coding: latin1 -*-\n__version__ = '\xe9'\nraise SystemExit(1)\n'])
def test_read_attr_encoding_cookie(self, example, tmp_path): (source)

Undocumented