=================================================================================================================================== test session starts ===================================================================================================================================
platform linux -- Python 3.13.2, pytest-8.3.5, pluggy-1.5.0
cachedir: .tox/py313-sphx_latest-attrs_latest-jsch_latest/.pytest_cache
rootdir: /home/danigm/Projects/suse/tmp/sphobjinv
configfile: tox.ini
plugins: flaky-3.8.1, timeout-2.3.1, ordering-0.6, check-2.5.3
collected 758 items
tests/test_api_fail.py ................................xxxx [ 4%]
tests/test_api_good.py ..............................................................................................................s.ssssssssssssssssssssssssssssssssssssssssssssssssssssssssssss.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss. [ 35%]
tests/test_api_good_nonlocal.py ..s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss [ 43%]
tests/test_cli.py ......s...s...s.........s.sssssssssssssssssssssssssssssssssssssssssssssssssssssssssss............................. [ 58%]
tests/test_cli_nonlocal.py ............ [ 60%]
tests/test_fixture.py ..... [ 61%]
tests/test_flake8_ext.py s [ 61%]
tests/test_intersphinx.py .... [ 61%]
tests/test_valid_objects.py .............................................xFFF..............FFF....x.................................................................................................F.............................................................................. [ 94%]
........................................... [100%]
======================================================================================================================================== FAILURES =========================================================================================================================================
______________________________________________________________________________________________________________________________ test_name_lead_chars[11_\x0b] ______________________________________________________________________________________________________________________________
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, leadint = 11
@pytest.mark.parametrize("leadint", range(255), ids=latin_1_id)
def test_name_lead_chars(misc_info, sphinx_ifile_data_count, leadint):
"""Screen for valid/invalid first characters."""
name = int_to_latin_1(leadint) + " foo"
# Expect only two fail cases, newline and '#'
if leadint in (10, 35):
pytest.xfail("Known invalid name lead char")
> test_dataobjstr_valid_objects(
misc_info,
sphinx_ifile_data_count,
name=name,
domain="py",
role="data",
prio=1,
uri="data.html#$",
dispname="-",
)
tests/test_valid_objects.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, name = '\x0b foo', domain = 'py', role = 'data', prio = 1, uri = 'data.html#$', dispname = '-'
@pytest.mark.parametrize(
("name", "domain", "role", "prio", "uri", "dispname"),
[
("foo", "py", "data", 1, "quux.html#$", "-"), # Priorities
("foo", "py", "data", 0, "quux.html#$", "-"),
("foo", "py", "data", -1, "quux.html#$", "-"),
("foo", "py", "data", -1235778, "quux.html#$", "-"),
("foo", "py", "data", 2214888, "quux.html#$", "-"),
("foo bar", "std", "term", 1, "quux.html#$", "-"), # Space in name
("foo\tbar", "std", "term", 1, "quux.html#$", "-"), # Valid but discouraged
("Index Page", "std", "doc", 1, "index.html", "-"),
("Index Page", "std", "doc", 1, "index.html", "Index Page Thing"),
("Index Page", "std", "doc", 1, "index.html", "Index\tPage\tThing"),
("Index Page", "std", "doc", 1, "", "-"), # Zero-length uri
("Index # Page", "std", "doc", 1, "index.html", "-"), # Symbol in name
("Thing \u33a4", "std", "ref", 1, "index.html#$", "-"), # Unicode in name
("Thing One", "std", "ref", 1, "index.html#$", "\u33a4"), # Unicode in dispname
("foo", "py", "da:ta", 1, "data.html#$", "-"), # Colon in role (used in Sphinx)
("foo", "py$", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py\u33a4", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data$", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data\u33a4", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data", 1, "data/\u33a4.html#$", "-"), # Valid but discouraged
(" foo", "py", "data", 1, "data.html#$", "-"), # Valid but discouraged
# Colon in domain (invalid but undetectable)
("foo", "p:y", "data", 1, "data.html#$", "-"),
],
)
def test_dataobjstr_valid_objects(
misc_info, sphinx_ifile_data_count, name, domain, role, prio, uri, dispname
):
"""Run sphobjinv/sphinx comparison on specific object data lines."""
dos = soi.DataObjStr(
name=name,
domain=domain,
role=role,
priority=str(prio),
uri=uri,
dispname=dispname,
)
assert dos
inv = soi.Inventory()
inv.project = "Foo"
inv.version = "1.0"
inv.objects.append(
soi.DataObjStr(
name="bar", domain="py", role="data", priority="1", uri="$", dispname="-"
)
)
inv.objects.append(dos)
df = inv.data_file(contract=True)
ifile_data = IFile.load(BytesIO(soi.compress(df)), "", osp.join)
ifile_count = sphinx_ifile_data_count(ifile_data)
assert inv.count == ifile_count
domrole = "{dos.domain}:{dos.role}".format(dos=dos)
assert domrole in ifile_data
> assert dos.name in ifile_data[domrole]
E AssertionError: assert '\x0b foo' in {' foo': _InventoryItem(project_name='Foo', project_version='1.0', uri='data.html# foo', display_name='-'), 'bar': _InventoryItem(project_name='Foo', project_version='1.0', uri='bar', display_name='-')}
E + where '\x0b foo' = DataObjStr(name='\x0b foo', domain='py', role='data', priority='1', uri='data.html#$', dispname='-').name
tests/test_valid_objects.py:123: AssertionError
______________________________________________________________________________________________________________________________ test_name_lead_chars[12_\x0c] ______________________________________________________________________________________________________________________________
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, leadint = 12
@pytest.mark.parametrize("leadint", range(255), ids=latin_1_id)
def test_name_lead_chars(misc_info, sphinx_ifile_data_count, leadint):
"""Screen for valid/invalid first characters."""
name = int_to_latin_1(leadint) + " foo"
# Expect only two fail cases, newline and '#'
if leadint in (10, 35):
pytest.xfail("Known invalid name lead char")
> test_dataobjstr_valid_objects(
misc_info,
sphinx_ifile_data_count,
name=name,
domain="py",
role="data",
prio=1,
uri="data.html#$",
dispname="-",
)
tests/test_valid_objects.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, name = '\x0c foo', domain = 'py', role = 'data', prio = 1, uri = 'data.html#$', dispname = '-'
@pytest.mark.parametrize(
("name", "domain", "role", "prio", "uri", "dispname"),
[
("foo", "py", "data", 1, "quux.html#$", "-"), # Priorities
("foo", "py", "data", 0, "quux.html#$", "-"),
("foo", "py", "data", -1, "quux.html#$", "-"),
("foo", "py", "data", -1235778, "quux.html#$", "-"),
("foo", "py", "data", 2214888, "quux.html#$", "-"),
("foo bar", "std", "term", 1, "quux.html#$", "-"), # Space in name
("foo\tbar", "std", "term", 1, "quux.html#$", "-"), # Valid but discouraged
("Index Page", "std", "doc", 1, "index.html", "-"),
("Index Page", "std", "doc", 1, "index.html", "Index Page Thing"),
("Index Page", "std", "doc", 1, "index.html", "Index\tPage\tThing"),
("Index Page", "std", "doc", 1, "", "-"), # Zero-length uri
("Index # Page", "std", "doc", 1, "index.html", "-"), # Symbol in name
("Thing \u33a4", "std", "ref", 1, "index.html#$", "-"), # Unicode in name
("Thing One", "std", "ref", 1, "index.html#$", "\u33a4"), # Unicode in dispname
("foo", "py", "da:ta", 1, "data.html#$", "-"), # Colon in role (used in Sphinx)
("foo", "py$", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py\u33a4", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data$", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data\u33a4", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data", 1, "data/\u33a4.html#$", "-"), # Valid but discouraged
(" foo", "py", "data", 1, "data.html#$", "-"), # Valid but discouraged
# Colon in domain (invalid but undetectable)
("foo", "p:y", "data", 1, "data.html#$", "-"),
],
)
def test_dataobjstr_valid_objects(
misc_info, sphinx_ifile_data_count, name, domain, role, prio, uri, dispname
):
"""Run sphobjinv/sphinx comparison on specific object data lines."""
dos = soi.DataObjStr(
name=name,
domain=domain,
role=role,
priority=str(prio),
uri=uri,
dispname=dispname,
)
assert dos
inv = soi.Inventory()
inv.project = "Foo"
inv.version = "1.0"
inv.objects.append(
soi.DataObjStr(
name="bar", domain="py", role="data", priority="1", uri="$", dispname="-"
)
)
inv.objects.append(dos)
df = inv.data_file(contract=True)
ifile_data = IFile.load(BytesIO(soi.compress(df)), "", osp.join)
ifile_count = sphinx_ifile_data_count(ifile_data)
assert inv.count == ifile_count
domrole = "{dos.domain}:{dos.role}".format(dos=dos)
assert domrole in ifile_data
> assert dos.name in ifile_data[domrole]
E AssertionError: assert '\x0c foo' in {' foo': _InventoryItem(project_name='Foo', project_version='1.0', uri='data.html# foo', display_name='-'), 'bar': _InventoryItem(project_name='Foo', project_version='1.0', uri='bar', display_name='-')}
E + where '\x0c foo' = DataObjStr(name='\x0c foo', domain='py', role='data', priority='1', uri='data.html#$', dispname='-').name
tests/test_valid_objects.py:123: AssertionError
_______________________________________________________________________________________________________________________________ test_name_lead_chars[13_\r] _______________________________________________________________________________________________________________________________
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, leadint = 13
@pytest.mark.parametrize("leadint", range(255), ids=latin_1_id)
def test_name_lead_chars(misc_info, sphinx_ifile_data_count, leadint):
"""Screen for valid/invalid first characters."""
name = int_to_latin_1(leadint) + " foo"
# Expect only two fail cases, newline and '#'
if leadint in (10, 35):
pytest.xfail("Known invalid name lead char")
> test_dataobjstr_valid_objects(
misc_info,
sphinx_ifile_data_count,
name=name,
domain="py",
role="data",
prio=1,
uri="data.html#$",
dispname="-",
)
tests/test_valid_objects.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, name = '\r foo', domain = 'py', role = 'data', prio = 1, uri = 'data.html#$', dispname = '-'
@pytest.mark.parametrize(
("name", "domain", "role", "prio", "uri", "dispname"),
[
("foo", "py", "data", 1, "quux.html#$", "-"), # Priorities
("foo", "py", "data", 0, "quux.html#$", "-"),
("foo", "py", "data", -1, "quux.html#$", "-"),
("foo", "py", "data", -1235778, "quux.html#$", "-"),
("foo", "py", "data", 2214888, "quux.html#$", "-"),
("foo bar", "std", "term", 1, "quux.html#$", "-"), # Space in name
("foo\tbar", "std", "term", 1, "quux.html#$", "-"), # Valid but discouraged
("Index Page", "std", "doc", 1, "index.html", "-"),
("Index Page", "std", "doc", 1, "index.html", "Index Page Thing"),
("Index Page", "std", "doc", 1, "index.html", "Index\tPage\tThing"),
("Index Page", "std", "doc", 1, "", "-"), # Zero-length uri
("Index # Page", "std", "doc", 1, "index.html", "-"), # Symbol in name
("Thing \u33a4", "std", "ref", 1, "index.html#$", "-"), # Unicode in name
("Thing One", "std", "ref", 1, "index.html#$", "\u33a4"), # Unicode in dispname
("foo", "py", "da:ta", 1, "data.html#$", "-"), # Colon in role (used in Sphinx)
("foo", "py$", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py\u33a4", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data$", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data\u33a4", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data", 1, "data/\u33a4.html#$", "-"), # Valid but discouraged
(" foo", "py", "data", 1, "data.html#$", "-"), # Valid but discouraged
# Colon in domain (invalid but undetectable)
("foo", "p:y", "data", 1, "data.html#$", "-"),
],
)
def test_dataobjstr_valid_objects(
misc_info, sphinx_ifile_data_count, name, domain, role, prio, uri, dispname
):
"""Run sphobjinv/sphinx comparison on specific object data lines."""
dos = soi.DataObjStr(
name=name,
domain=domain,
role=role,
priority=str(prio),
uri=uri,
dispname=dispname,
)
assert dos
inv = soi.Inventory()
inv.project = "Foo"
inv.version = "1.0"
inv.objects.append(
soi.DataObjStr(
name="bar", domain="py", role="data", priority="1", uri="$", dispname="-"
)
)
inv.objects.append(dos)
df = inv.data_file(contract=True)
ifile_data = IFile.load(BytesIO(soi.compress(df)), "", osp.join)
ifile_count = sphinx_ifile_data_count(ifile_data)
assert inv.count == ifile_count
domrole = "{dos.domain}:{dos.role}".format(dos=dos)
assert domrole in ifile_data
> assert dos.name in ifile_data[domrole]
E AssertionError: assert '\r foo' in {' foo': _InventoryItem(project_name='Foo', project_version='1.0', uri='data.html# foo', display_name='-'), 'bar': _InventoryItem(project_name='Foo', project_version='1.0', uri='bar', display_name='-')}
E + where '\r foo' = DataObjStr(name='\r foo', domain='py', role='data', priority='1', uri='data.html#$', dispname='-').name
tests/test_valid_objects.py:123: AssertionError
______________________________________________________________________________________________________________________________ test_name_lead_chars[28_\x1c] ______________________________________________________________________________________________________________________________
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, leadint = 28
@pytest.mark.parametrize("leadint", range(255), ids=latin_1_id)
def test_name_lead_chars(misc_info, sphinx_ifile_data_count, leadint):
"""Screen for valid/invalid first characters."""
name = int_to_latin_1(leadint) + " foo"
# Expect only two fail cases, newline and '#'
if leadint in (10, 35):
pytest.xfail("Known invalid name lead char")
> test_dataobjstr_valid_objects(
misc_info,
sphinx_ifile_data_count,
name=name,
domain="py",
role="data",
prio=1,
uri="data.html#$",
dispname="-",
)
tests/test_valid_objects.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, name = '\x1c foo', domain = 'py', role = 'data', prio = 1, uri = 'data.html#$', dispname = '-'
@pytest.mark.parametrize(
("name", "domain", "role", "prio", "uri", "dispname"),
[
("foo", "py", "data", 1, "quux.html#$", "-"), # Priorities
("foo", "py", "data", 0, "quux.html#$", "-"),
("foo", "py", "data", -1, "quux.html#$", "-"),
("foo", "py", "data", -1235778, "quux.html#$", "-"),
("foo", "py", "data", 2214888, "quux.html#$", "-"),
("foo bar", "std", "term", 1, "quux.html#$", "-"), # Space in name
("foo\tbar", "std", "term", 1, "quux.html#$", "-"), # Valid but discouraged
("Index Page", "std", "doc", 1, "index.html", "-"),
("Index Page", "std", "doc", 1, "index.html", "Index Page Thing"),
("Index Page", "std", "doc", 1, "index.html", "Index\tPage\tThing"),
("Index Page", "std", "doc", 1, "", "-"), # Zero-length uri
("Index # Page", "std", "doc", 1, "index.html", "-"), # Symbol in name
("Thing \u33a4", "std", "ref", 1, "index.html#$", "-"), # Unicode in name
("Thing One", "std", "ref", 1, "index.html#$", "\u33a4"), # Unicode in dispname
("foo", "py", "da:ta", 1, "data.html#$", "-"), # Colon in role (used in Sphinx)
("foo", "py$", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py\u33a4", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data$", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data\u33a4", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data", 1, "data/\u33a4.html#$", "-"), # Valid but discouraged
(" foo", "py", "data", 1, "data.html#$", "-"), # Valid but discouraged
# Colon in domain (invalid but undetectable)
("foo", "p:y", "data", 1, "data.html#$", "-"),
],
)
def test_dataobjstr_valid_objects(
misc_info, sphinx_ifile_data_count, name, domain, role, prio, uri, dispname
):
"""Run sphobjinv/sphinx comparison on specific object data lines."""
dos = soi.DataObjStr(
name=name,
domain=domain,
role=role,
priority=str(prio),
uri=uri,
dispname=dispname,
)
assert dos
inv = soi.Inventory()
inv.project = "Foo"
inv.version = "1.0"
inv.objects.append(
soi.DataObjStr(
name="bar", domain="py", role="data", priority="1", uri="$", dispname="-"
)
)
inv.objects.append(dos)
df = inv.data_file(contract=True)
ifile_data = IFile.load(BytesIO(soi.compress(df)), "", osp.join)
ifile_count = sphinx_ifile_data_count(ifile_data)
assert inv.count == ifile_count
domrole = "{dos.domain}:{dos.role}".format(dos=dos)
assert domrole in ifile_data
> assert dos.name in ifile_data[domrole]
E AssertionError: assert '\x1c foo' in {' foo': _InventoryItem(project_name='Foo', project_version='1.0', uri='data.html# foo', display_name='-'), 'bar': _InventoryItem(project_name='Foo', project_version='1.0', uri='bar', display_name='-')}
E + where '\x1c foo' = DataObjStr(name='\x1c foo', domain='py', role='data', priority='1', uri='data.html#$', dispname='-').name
tests/test_valid_objects.py:123: AssertionError
______________________________________________________________________________________________________________________________ test_name_lead_chars[29_\x1d] ______________________________________________________________________________________________________________________________
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, leadint = 29
@pytest.mark.parametrize("leadint", range(255), ids=latin_1_id)
def test_name_lead_chars(misc_info, sphinx_ifile_data_count, leadint):
"""Screen for valid/invalid first characters."""
name = int_to_latin_1(leadint) + " foo"
# Expect only two fail cases, newline and '#'
if leadint in (10, 35):
pytest.xfail("Known invalid name lead char")
> test_dataobjstr_valid_objects(
misc_info,
sphinx_ifile_data_count,
name=name,
domain="py",
role="data",
prio=1,
uri="data.html#$",
dispname="-",
)
tests/test_valid_objects.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, name = '\x1d foo', domain = 'py', role = 'data', prio = 1, uri = 'data.html#$', dispname = '-'
@pytest.mark.parametrize(
("name", "domain", "role", "prio", "uri", "dispname"),
[
("foo", "py", "data", 1, "quux.html#$", "-"), # Priorities
("foo", "py", "data", 0, "quux.html#$", "-"),
("foo", "py", "data", -1, "quux.html#$", "-"),
("foo", "py", "data", -1235778, "quux.html#$", "-"),
("foo", "py", "data", 2214888, "quux.html#$", "-"),
("foo bar", "std", "term", 1, "quux.html#$", "-"), # Space in name
("foo\tbar", "std", "term", 1, "quux.html#$", "-"), # Valid but discouraged
("Index Page", "std", "doc", 1, "index.html", "-"),
("Index Page", "std", "doc", 1, "index.html", "Index Page Thing"),
("Index Page", "std", "doc", 1, "index.html", "Index\tPage\tThing"),
("Index Page", "std", "doc", 1, "", "-"), # Zero-length uri
("Index # Page", "std", "doc", 1, "index.html", "-"), # Symbol in name
("Thing \u33a4", "std", "ref", 1, "index.html#$", "-"), # Unicode in name
("Thing One", "std", "ref", 1, "index.html#$", "\u33a4"), # Unicode in dispname
("foo", "py", "da:ta", 1, "data.html#$", "-"), # Colon in role (used in Sphinx)
("foo", "py$", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py\u33a4", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data$", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data\u33a4", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data", 1, "data/\u33a4.html#$", "-"), # Valid but discouraged
(" foo", "py", "data", 1, "data.html#$", "-"), # Valid but discouraged
# Colon in domain (invalid but undetectable)
("foo", "p:y", "data", 1, "data.html#$", "-"),
],
)
def test_dataobjstr_valid_objects(
misc_info, sphinx_ifile_data_count, name, domain, role, prio, uri, dispname
):
"""Run sphobjinv/sphinx comparison on specific object data lines."""
dos = soi.DataObjStr(
name=name,
domain=domain,
role=role,
priority=str(prio),
uri=uri,
dispname=dispname,
)
assert dos
inv = soi.Inventory()
inv.project = "Foo"
inv.version = "1.0"
inv.objects.append(
soi.DataObjStr(
name="bar", domain="py", role="data", priority="1", uri="$", dispname="-"
)
)
inv.objects.append(dos)
df = inv.data_file(contract=True)
ifile_data = IFile.load(BytesIO(soi.compress(df)), "", osp.join)
ifile_count = sphinx_ifile_data_count(ifile_data)
assert inv.count == ifile_count
domrole = "{dos.domain}:{dos.role}".format(dos=dos)
assert domrole in ifile_data
> assert dos.name in ifile_data[domrole]
E AssertionError: assert '\x1d foo' in {' foo': _InventoryItem(project_name='Foo', project_version='1.0', uri='data.html# foo', display_name='-'), 'bar': _InventoryItem(project_name='Foo', project_version='1.0', uri='bar', display_name='-')}
E + where '\x1d foo' = DataObjStr(name='\x1d foo', domain='py', role='data', priority='1', uri='data.html#$', dispname='-').name
tests/test_valid_objects.py:123: AssertionError
______________________________________________________________________________________________________________________________ test_name_lead_chars[30_\x1e] ______________________________________________________________________________________________________________________________
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, leadint = 30
@pytest.mark.parametrize("leadint", range(255), ids=latin_1_id)
def test_name_lead_chars(misc_info, sphinx_ifile_data_count, leadint):
"""Screen for valid/invalid first characters."""
name = int_to_latin_1(leadint) + " foo"
# Expect only two fail cases, newline and '#'
if leadint in (10, 35):
pytest.xfail("Known invalid name lead char")
> test_dataobjstr_valid_objects(
misc_info,
sphinx_ifile_data_count,
name=name,
domain="py",
role="data",
prio=1,
uri="data.html#$",
dispname="-",
)
tests/test_valid_objects.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, name = '\x1e foo', domain = 'py', role = 'data', prio = 1, uri = 'data.html#$', dispname = '-'
@pytest.mark.parametrize(
("name", "domain", "role", "prio", "uri", "dispname"),
[
("foo", "py", "data", 1, "quux.html#$", "-"), # Priorities
("foo", "py", "data", 0, "quux.html#$", "-"),
("foo", "py", "data", -1, "quux.html#$", "-"),
("foo", "py", "data", -1235778, "quux.html#$", "-"),
("foo", "py", "data", 2214888, "quux.html#$", "-"),
("foo bar", "std", "term", 1, "quux.html#$", "-"), # Space in name
("foo\tbar", "std", "term", 1, "quux.html#$", "-"), # Valid but discouraged
("Index Page", "std", "doc", 1, "index.html", "-"),
("Index Page", "std", "doc", 1, "index.html", "Index Page Thing"),
("Index Page", "std", "doc", 1, "index.html", "Index\tPage\tThing"),
("Index Page", "std", "doc", 1, "", "-"), # Zero-length uri
("Index # Page", "std", "doc", 1, "index.html", "-"), # Symbol in name
("Thing \u33a4", "std", "ref", 1, "index.html#$", "-"), # Unicode in name
("Thing One", "std", "ref", 1, "index.html#$", "\u33a4"), # Unicode in dispname
("foo", "py", "da:ta", 1, "data.html#$", "-"), # Colon in role (used in Sphinx)
("foo", "py$", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py\u33a4", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data$", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data\u33a4", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data", 1, "data/\u33a4.html#$", "-"), # Valid but discouraged
(" foo", "py", "data", 1, "data.html#$", "-"), # Valid but discouraged
# Colon in domain (invalid but undetectable)
("foo", "p:y", "data", 1, "data.html#$", "-"),
],
)
def test_dataobjstr_valid_objects(
misc_info, sphinx_ifile_data_count, name, domain, role, prio, uri, dispname
):
"""Run sphobjinv/sphinx comparison on specific object data lines."""
dos = soi.DataObjStr(
name=name,
domain=domain,
role=role,
priority=str(prio),
uri=uri,
dispname=dispname,
)
assert dos
inv = soi.Inventory()
inv.project = "Foo"
inv.version = "1.0"
inv.objects.append(
soi.DataObjStr(
name="bar", domain="py", role="data", priority="1", uri="$", dispname="-"
)
)
inv.objects.append(dos)
df = inv.data_file(contract=True)
ifile_data = IFile.load(BytesIO(soi.compress(df)), "", osp.join)
ifile_count = sphinx_ifile_data_count(ifile_data)
assert inv.count == ifile_count
domrole = "{dos.domain}:{dos.role}".format(dos=dos)
assert domrole in ifile_data
> assert dos.name in ifile_data[domrole]
E AssertionError: assert '\x1e foo' in {' foo': _InventoryItem(project_name='Foo', project_version='1.0', uri='data.html# foo', display_name='-'), 'bar': _InventoryItem(project_name='Foo', project_version='1.0', uri='bar', display_name='-')}
E + where '\x1e foo' = DataObjStr(name='\x1e foo', domain='py', role='data', priority='1', uri='data.html#$', dispname='-').name
tests/test_valid_objects.py:123: AssertionError
_____________________________________________________________________________________________________________________________ test_name_lead_chars[133_\x85] ______________________________________________________________________________________________________________________________
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, leadint = 133
@pytest.mark.parametrize("leadint", range(255), ids=latin_1_id)
def test_name_lead_chars(misc_info, sphinx_ifile_data_count, leadint):
"""Screen for valid/invalid first characters."""
name = int_to_latin_1(leadint) + " foo"
# Expect only two fail cases, newline and '#'
if leadint in (10, 35):
pytest.xfail("Known invalid name lead char")
> test_dataobjstr_valid_objects(
misc_info,
sphinx_ifile_data_count,
name=name,
domain="py",
role="data",
prio=1,
uri="data.html#$",
dispname="-",
)
tests/test_valid_objects.py:173:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
misc_info = <conftest.misc_info.<locals>.Info object at 0x7fc584c7c1a0>, sphinx_ifile_data_count = <function sphinx_ifile_data_count at 0x7fc584f368e0>, name = '\x85 foo', domain = 'py', role = 'data', prio = 1, uri = 'data.html#$', dispname = '-'
@pytest.mark.parametrize(
("name", "domain", "role", "prio", "uri", "dispname"),
[
("foo", "py", "data", 1, "quux.html#$", "-"), # Priorities
("foo", "py", "data", 0, "quux.html#$", "-"),
("foo", "py", "data", -1, "quux.html#$", "-"),
("foo", "py", "data", -1235778, "quux.html#$", "-"),
("foo", "py", "data", 2214888, "quux.html#$", "-"),
("foo bar", "std", "term", 1, "quux.html#$", "-"), # Space in name
("foo\tbar", "std", "term", 1, "quux.html#$", "-"), # Valid but discouraged
("Index Page", "std", "doc", 1, "index.html", "-"),
("Index Page", "std", "doc", 1, "index.html", "Index Page Thing"),
("Index Page", "std", "doc", 1, "index.html", "Index\tPage\tThing"),
("Index Page", "std", "doc", 1, "", "-"), # Zero-length uri
("Index # Page", "std", "doc", 1, "index.html", "-"), # Symbol in name
("Thing \u33a4", "std", "ref", 1, "index.html#$", "-"), # Unicode in name
("Thing One", "std", "ref", 1, "index.html#$", "\u33a4"), # Unicode in dispname
("foo", "py", "da:ta", 1, "data.html#$", "-"), # Colon in role (used in Sphinx)
("foo", "py$", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py\u33a4", "data", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data$", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data\u33a4", 1, "data.html#$", "-"), # Valid but discouraged
("foo", "py", "data", 1, "data/\u33a4.html#$", "-"), # Valid but discouraged
(" foo", "py", "data", 1, "data.html#$", "-"), # Valid but discouraged
# Colon in domain (invalid but undetectable)
("foo", "p:y", "data", 1, "data.html#$", "-"),
],
)
def test_dataobjstr_valid_objects(
misc_info, sphinx_ifile_data_count, name, domain, role, prio, uri, dispname
):
"""Run sphobjinv/sphinx comparison on specific object data lines."""
dos = soi.DataObjStr(
name=name,
domain=domain,
role=role,
priority=str(prio),
uri=uri,
dispname=dispname,
)
assert dos
inv = soi.Inventory()
inv.project = "Foo"
inv.version = "1.0"
inv.objects.append(
soi.DataObjStr(
name="bar", domain="py", role="data", priority="1", uri="$", dispname="-"
)
)
inv.objects.append(dos)
df = inv.data_file(contract=True)
ifile_data = IFile.load(BytesIO(soi.compress(df)), "", osp.join)
ifile_count = sphinx_ifile_data_count(ifile_data)
assert inv.count == ifile_count
domrole = "{dos.domain}:{dos.role}".format(dos=dos)
assert domrole in ifile_data
> assert dos.name in ifile_data[domrole]
E AssertionError: assert '\x85 foo' in {' foo': _InventoryItem(project_name='Foo', project_version='1.0', uri='data.html# foo', display_name='-'), 'bar': _InventoryItem(project_name='Foo', project_version='1.0', uri='bar', display_name='-')}
E + where '\x85 foo' = DataObjStr(name='\x85 foo', domain='py', role='data', priority='1', uri='data.html#$', dispname='-').name
tests/test_valid_objects.py:123: AssertionError
test_name_lead_charsfails with sphinx >= 8.2Failing tests:
Full output: