Open marcdexet-cnrs opened 2 years ago
As I'm using VSCode and it's testRunner, it's bothering as if a test fails, I only get this output in logs.
./tests/test_person.py::test_change_name Failed: [undefined]RuntimeError: This machine has no reporter configuration
def test_change_name():
p = Person('Foo', 'BAR', Sex.female, 42)
p.forname = 'Rosetta'
> verify(p)
tests/test_person.py:14:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
.venv/lib/python3.8/site-packages/approvaltests/file_approver.py:53: in verify
ok = self.verify_files(approved, received, reporter,comparator)
.venv/lib/python3.8/site-packages/approvaltests/file_approver.py:70: in verify_files
worked = reporter.report(received_file, approved_file)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
self = <approvaltests.reporters.generic_diff_reporter_factory.NoConfigReporter object at 0x7fa508738fd0>
received_path = '/home/cram/Workdir/temporary_projects/approvals/tests/test_person.test_change_name.received.txt'
approved_path = '/home/cram/Workdir/temporary_projects/approvals/tests/test_person.test_change_name.approved.txt'
def report(self, received_path: str, approved_path: str) -> bool:
> raise RuntimeError("This machine has no reporter configuration")
E RuntimeError: This machine has no reporter configuration
.venv/lib/python3.8/site-packages/approvaltests/reporters/generic_diff_reporter_factory.py:16: RuntimeError
Total number of tests expected to run: 2
Total number of tests run: 2
Total number of tests passed: 1
Total number of tests failed: 1
Total number of tests failed with errors: 0
Total number of tests skipped: 0
Total number of tests with no result data: 0
Finished running tests!
> Test run finished at 04/04/2022, 18:27:16 <
Hi,
I have
When I run pytest with
pytest --approvaltests-use-reporter='PythonNative' -vv
I get an errorIf I run with
diff
, there's no problemI don't understand why I get such a behavoir.