r"""*Direct, NONLOCAL expect-good API tests for* ``sphobjinv``.

``sphobjinv`` is a toolkit for manipulation and inspection of
Sphinx |objects.inv| files.

**Author**
    Brian Skinn (bskinn@alum.mit.edu)

**File Created**
    21 Mar 2019

**Copyright**
    \(c) Brian Skinn 2016-2019

**Source Repository**
    http://www.github.com/bskinn/sphobjinv

**Documentation**
    http://sphobjinv.readthedocs.io

**License**
    The MIT License; see |license_txt|_ for full license terms

**Members**

"""

from pathlib import Path

import pytest

import sphobjinv as soi


pytestmark = [pytest.mark.api, pytest.mark.good, pytest.mark.nonloc]


testall_inv_paths = (
    p
    for p in (Path(__file__).parent / "resource").iterdir()
    if p.name.startswith("objects_") and p.name.endswith(".inv")
)


@pytest.mark.parametrize("inv_path", list(testall_inv_paths), ids=(lambda p: p.name))
@pytest.mark.testall
@pytest.mark.timeout(20)
def test_api_inventory_many_url_imports(
    inv_path, res_path, scratch_path, misc_info, sphinx_load_test, pytestconfig
):
    """Confirm a plethora of .inv files downloads properly via url arg.

    This test is SLOW, and so does not run by default.  Invoke with `--nonloc`
    to run it; invoke with `--testall` to test over all .inv files in
    tests/resource.

    """
    fname = inv_path.name
    scr_fpath = scratch_path / fname

    # Drop unless nonlocal
    if not pytestconfig.getoption("--nonloc"):
        pytest.skip("'--nonloc' not specified")

    # Drop most unless testall
    if not pytestconfig.getoption("--testall") and fname != "objects_attrs.inv":
        pytest.skip("'--testall' not specified")

    # Construct inventories for comparison
    mch = misc_info.p_inv.match(fname)
    proj_name = mch.group(1)
    inv1 = soi.Inventory(str(res_path / fname))
    inv2 = soi.Inventory(url=misc_info.remote_url.format(proj_name))

    # Test the things
    assert inv1.project == inv2.project
    assert inv1.version == inv2.version
    assert inv1.count == inv2.count
    for objs in zip(inv1.objects, inv2.objects):
        assert objs[0].name == objs[1].name
        assert objs[0].domain == objs[1].domain
        assert objs[0].role == objs[1].role
        assert objs[0].uri == objs[1].uri
        assert objs[0].priority == objs[1].priority
        assert objs[0].dispname == objs[1].dispname

    # Ensure sphinx likes the regenerated inventory
    data = inv2.data_file()
    cmp_data = soi.compress(data)
    soi.writebytes(str(scr_fpath), cmp_data)
    sphinx_load_test(scr_fpath)


if __name__ == "__main__":
    print("Module not executable.")

@@ -975,16 +975,20 @@
 nv_path,
+%0A   
  res_pat
@@ -989,16 +989,20 @@
 es_path,
+%0A   
  scratch
@@ -1007,16 +1007,20 @@
 ch_path,
+%0A   
  misc_in
@@ -1022,16 +1022,20 @@
 sc_info,
+%0A   
  sphinx_
@@ -1044,16 +1044,20 @@
 ad_test,
+%0A   
  pytestc
@@ -1061,16 +1061,31 @@
 stconfig
+,%0A    subtests,
 %0A):%0A    
@@ -1931,16 +1931,62 @@
  things%0A
+    with subtests.test(msg=%22properties%22):%0A    
     asse
@@ -2017,16 +2017,20 @@
 project%0A
+    
     asse
@@ -2061,16 +2061,20 @@
 version%0A
+    
     asse
@@ -2101,16 +2101,20 @@
 2.count%0A
+    
     for 
@@ -2154,32 +2154,36 @@
 jects):%0A        
+    
 assert objs%5B0%5D.n
@@ -2202,32 +2202,36 @@
 1%5D.name%0A        
+ 
+   
 assert objs%5B0%5D.d
@@ -2254,32 +2254,36 @@
 .domain%0A        
+    
 assert objs%5B0%5D.r
@@ -2302,32 +2302,36 @@
 1%5D.role%0A        
+ 
+   
 assert objs%5B0%5D.u
@@ -2348,16 +2348,20 @@
 %5B1%5D.uri%0A
+    
         
@@ -2404,16 +2404,20 @@
 riority%0A
+    
         
@@ -2513,16 +2513,63 @@
 ventory%0A
+    with subtests.test(msg=%22sphinx_load%22):%0A    
     data
@@ -2588,16 +2588,20 @@
 _file()%0A
+    
     cmp_
@@ -2622,24 +2622,28 @@
 press(data)%0A
+    
     soi.writ
@@ -2671,24 +2671,28 @@
 , cmp_data)%0A
+    
     sphinx_l

Add subtests to api_good_nonlocal