Skip to content

Commit

Permalink
Made all xfails strict, so that an xpass in a package resource read i…
Browse files Browse the repository at this point in the history
…s recorded as a failure
  • Loading branch information
timbernat committed Aug 29, 2024
1 parent 8208c97 commit 5dafd0e
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions polymerist/tests/genutils/test_pkginspect.py
Original file line number Diff line number Diff line change
Expand Up @@ -78,9 +78,9 @@ def test_is_module_fail_on_invalid_types(non_module_type : type) -> None:
[
('data', tests),
('data/sample.dat', tests),
pytest.param('daata/simple.dat', tests, marks=pytest.mark.xfail(raises=ValueError, reason="This isn't a real file")),
pytest.param('daata/simple.dat', tests, marks=pytest.mark.xfail(raises=ValueError, reason="This isn't a real file", strict=True)),
('pkginspect.py', genutils),
pytest.param('fake/whatever.txt', pkginspect, marks=pytest.mark.xfail(raises=TypeError, reason="Module is not a package and therefore cannot contain resources")),
pytest.param('fake/whatever.txt', pkginspect, marks=pytest.mark.xfail(raises=TypeError, reason="Module is not a package and therefore cannot contain resources", strict=True)),
]
)
def test_get_resource_path(rel_path : str, module : ModuleType) -> None:
Expand All @@ -91,11 +91,11 @@ def test_get_resource_path(rel_path : str, module : ModuleType) -> None:
@pytest.mark.parametrize(
'rel_path, module',
[
pytest.param('data', tests, marks=pytest.mark.xfail(raises=FileNotFoundError, reason="This is a directory, NOT a file")),
pytest.param('data', tests, marks=pytest.mark.xfail(raises=FileNotFoundError, reason="This is a directory, NOT a file", strict=True)),
('data/sample.dat', tests),
pytest.param('daata/simple.dat', tests, marks=pytest.mark.xfail(raises=ValueError, reason="This isn't a real file")),
pytest.param('daata/simple.dat', tests, marks=pytest.mark.xfail(raises=ValueError, reason="This isn't a real file", strict=True)),
('pkginspect.py', genutils),
pytest.param('fake/whatever.txt', pkginspect, marks=pytest.mark.xfail(raises=TypeError, reason="Module is not a package and therefore cannot contain resources")),
pytest.param('fake/whatever.txt', pkginspect, marks=pytest.mark.xfail(raises=TypeError, reason="Module is not a package and therefore cannot contain resources", strict=True)),
]
)
def test_get_file_path(rel_path : str, module : ModuleType) -> None:
Expand All @@ -107,10 +107,10 @@ def test_get_file_path(rel_path : str, module : ModuleType) -> None:
'rel_path, module',
[
('data', tests),
pytest.param('data/sample.dat', tests, marks=pytest.mark.xfail(raises=NotADirectoryError, reason='This IS a real file, but not a directory')),
pytest.param('daata/simple.dat', tests, marks=pytest.mark.xfail(raises=ValueError, reason="This isn't a real file")),
pytest.param('pkginspect.py', genutils, marks=pytest.mark.xfail(raises=NotADirectoryError, reason='This IS a real file, but not a directory')),
pytest.param('fake/whatever.txt', pkginspect, marks=pytest.mark.xfail(raises=TypeError, reason="Module is not a package and therefore cannot contain resources")),
pytest.param('data/sample.dat', tests, marks=pytest.mark.xfail(raises=NotADirectoryError, reason='This IS a real file, but not a directory', strict=True)),
pytest.param('daata/simple.dat', tests, marks=pytest.mark.xfail(raises=ValueError, reason="This isn't a real file", strict=True)),
pytest.param('pkginspect.py', genutils, marks=pytest.mark.xfail(raises=NotADirectoryError, reason='This IS a real file, but not a directory', strict=True)),
pytest.param('fake/whatever.txt', pkginspect, marks=pytest.mark.xfail(raises=TypeError, reason="Module is not a package and therefore cannot contain resources", strict=True)),
]
)
def test_get_dir_path(rel_path : str, module : ModuleType) -> None:
Expand Down

0 comments on commit 5dafd0e

Please sign in to comment.