Skip to content

Commit e8877b0

Browse files
mathbouMathieu
authored and
Mathieu
committed
✅ fix seeding test assertion
1 parent 26fd5c7 commit e8877b0

11 files changed

+19
-18
lines changed

seed_intersphinx_mapping/fallback_mapping.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929
"scikit-learn": "https://scikit-learn.org/stable/",
3030
"six": "https://six.readthedocs.io/",
3131
"slumber": "https://slumber.readthedocs.io/en/v0.6.0/",
32-
"sphinx": "https://www.sphinx-doc.org/en/3.x/",
32+
"sphinx": "https://www.sphinx-doc.org/en/master/",
3333
"typing": "https://docs.python.org/3/",
3434
"typing-extensions": "https://typing-extensions.readthedocs.io/en/latest/",
3535
"typing_extensions": "https://typing-extensions.readthedocs.io/en/latest/",

tests/test_seeding.py

+9-8
Original file line numberDiff line numberDiff line change
@@ -25,12 +25,12 @@
2525
"packaging": ("https://packaging.pypa.io/en/stable/", None),
2626
"requests": ("https://requests.readthedocs.io/en/latest/", None),
2727
"slumber": ("https://slumber.readthedocs.io/en/v0.6.0/", None),
28-
"sphinx": ("https://www.sphinx-doc.org/en/3.x/", None),
28+
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
2929
}
3030
bad_expected_mapping = {
3131
"domdf-python-tools": ("https://domdf-python-tools.readthedocs.io/en/latest/", None),
32-
"packaging": ("https://packaging.pypa.io/en/stable/", None),
33-
"sphinx": ("https://www.sphinx-doc.org/en/3.x/", None),
32+
"packaging": ("https://packaging.pypa.io/en/latest/", None),
33+
"sphinx": ("https://www.sphinx-doc.org/en/master/", None),
3434
}
3535

3636

@@ -50,12 +50,12 @@ def test_seed_intersphinx_mapping(
5050

5151
assert seed_intersphinx_mapping(*parse_requirements_txt(tmp_pathplus)) == expects
5252
err = capsys.readouterr().err
53-
assert err == "WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n"
53+
assert "WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n" in err
5454

5555
requirements, comments, invalid = read_requirements(tmp_pathplus / "requirements.txt", include_invalid=True)
5656
assert seed_intersphinx_mapping(*requirements) == expects
5757
err = capsys.readouterr().err
58-
assert err == "WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n"
58+
assert "WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n" in err
5959

6060

6161
@pytest.mark.parametrize(
@@ -70,7 +70,7 @@ def test_seed_intersphinx_mapping_pyproject(tmp_pathplus: PathPlus, contents: st
7070

7171
assert seed_intersphinx_mapping(*parse_pyproject_toml(tmp_pathplus)) == expects
7272
err = capsys.readouterr().err
73-
assert err == "WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n"
73+
assert err.endswith("WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n")
7474

7575

7676
@pytest.mark.parametrize(
@@ -85,7 +85,7 @@ def test_seed_intersphinx_mapping_flit(tmp_pathplus: PathPlus, contents: str, ex
8585

8686
assert seed_intersphinx_mapping(*parse_flit_requirements(tmp_pathplus)) == expects
8787
err = capsys.readouterr().err
88-
assert err == "WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n"
88+
assert err.endswith("WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n")
8989

9090

9191
@pytest.mark.parametrize("pkg_requirements_source", ["requirements", "flit", "pyproject", "pyproject.toml"])
@@ -125,7 +125,8 @@ def test_sphinx_seed_intersphinx_mapping_mocked(
125125
advanced_data_regression.check(config.intersphinx_mapping)
126126

127127
err = capsys.readouterr().err
128-
assert err == "WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n"
128+
129+
assert err.endswith("WARNING: Unable to determine documentation url for project sphinxcontrib-domaintools\n")
129130

130131

131132
def test_sphinx_seed_intersphinx_mapping_list_mocked(

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_list_mocked.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ slumber:
1616
- - null
1717
sphinx:
1818
- sphinx
19-
- - https://www.sphinx-doc.org/en/3.x/
19+
- - https://www.sphinx-doc.org/en/master/
2020
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_bad_example_requirements_flit_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ packaging:
88
- - null
99
sphinx:
1010
- sphinx
11-
- - https://www.sphinx-doc.org/en/3.x/
11+
- - https://www.sphinx-doc.org/en/master/
1212
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_bad_example_requirements_pyproject_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ packaging:
88
- - null
99
sphinx:
1010
- sphinx
11-
- - https://www.sphinx-doc.org/en/3.x/
11+
- - https://www.sphinx-doc.org/en/master/
1212
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_bad_example_requirements_pyproject_toml_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ packaging:
88
- - null
99
sphinx:
1010
- sphinx
11-
- - https://www.sphinx-doc.org/en/3.x/
11+
- - https://www.sphinx-doc.org/en/master/
1212
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_bad_example_requirements_requirements_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,5 @@ packaging:
88
- - null
99
sphinx:
1010
- sphinx
11-
- - https://www.sphinx-doc.org/en/3.x/
11+
- - https://www.sphinx-doc.org/en/master/
1212
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_example_requirements_a_flit_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ slumber:
1616
- - null
1717
sphinx:
1818
- sphinx
19-
- - https://www.sphinx-doc.org/en/3.x/
19+
- - https://www.sphinx-doc.org/en/master/
2020
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_example_requirements_a_pyproject_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ slumber:
1616
- - null
1717
sphinx:
1818
- sphinx
19-
- - https://www.sphinx-doc.org/en/3.x/
19+
- - https://www.sphinx-doc.org/en/master/
2020
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_example_requirements_a_pyproject_toml_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ slumber:
1616
- - null
1717
sphinx:
1818
- sphinx
19-
- - https://www.sphinx-doc.org/en/3.x/
19+
- - https://www.sphinx-doc.org/en/master/
2020
- - null

tests/test_seeding_/test_sphinx_seed_intersphinx_mapping_mocked_example_requirements_a_requirements_.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,5 @@ slumber:
1616
- - null
1717
sphinx:
1818
- sphinx
19-
- - https://www.sphinx-doc.org/en/3.x/
19+
- - https://www.sphinx-doc.org/en/master/
2020
- - null

0 commit comments

Comments
 (0)