Closed Sheila-nk closed 1 year ago
@ev-br I am not too sure about this issue. Mainly because some test cases that you wrote already check correct behavior, which is that they fail. I wrote a test case to check correct behavior of the plugin as well by asserting that the doctests fail.
def test_failure_cases(pytester):
file_list = [failure_cases, failure_cases_2]
for file in file_list:
path_str = file.__file__
python_file = PosixPath(path_str)
result = pytester.inline_run(python_file, "--doctest-modules")
assert result.ret == pytest.ExitCode.TESTS_FAILED
I am not sure we need to refactor the failure_cases
especially since they fail when running python -m pytest --doctest-modules
which is expected anyway.
Unless I misunderstood the task.
OK, so the failure occurs in an unsupported way of running tests. The recommended way is
$ pytest --pyargs scpdt
which runs all tests and reports success. Which is fine then.
Closing this issue since failure_cases
don't need restructuring.
Good point about
failure_cases
. They are indeed failing, and 'old-way' tests check that they do. Would be great to restructure these so that they pass both ways.Originally posted by @ev-br in https://github.com/ev-br/scpdt/issues/84#issuecomment-1653337023