Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warnings are not reported #22

Open
jeffwright13 opened this issue Jan 15, 2023 · 0 comments
Open

Warnings are not reported #22

jeffwright13 opened this issue Jan 15, 2023 · 0 comments

Comments

@jeffwright13
Copy link

I have a suite of dummy tests that I use to generate a lot of different outcomes. Besides not reporting Reruns (mentioned in another issue here), pytest-md also does not report Warnings.

Console output short test summary info from running the suite mentioned above:
22 failed, 33 passed, 5 skipped, 9 xfailed, 5 xpassed, 27 warnings, 6 errors, 10 rerun in 43.89s

...versus pytest-markdown output (missing Warnings and Reruns):

# Test Report

*Report generated on 15-Jan-2023 at 10:37:05 by [pytest-md]*

[pytest-md]: https://github.com/hackebrot/pytest-md

## Summary

80 tests ran in 43.69 seconds

- 6 error
- 22 failed
- 33 passed
- 5 skipped
- 9 xfailed
- 5 xpassed

More details from output:

============================================================================================================ warnings summary ============================================================================================================
demo-tests/test_0.py::test0_warning
  /Users/jwr003/coding/pytest-tui/demo-tests/test_0.py:71: UserWarning: api v1, should use functions from v2
    warnings.warn(UserWarning("api v1, should use functions from v2"))

demo-tests/test_random_results.py::test_4
  /Users/jwr003/coding/pytest-tui/demo-tests/test_random_results.py:188: UserWarning: Warning: Serious inside else memory if six.
    warnings.warn(random_result.log_msg)

demo-tests/test_random_results.py::test_10
  /Users/jwr003/coding/pytest-tui/demo-tests/test_random_results.py:344: UserWarning: Warning: Serious inside else memory if six.
    warnings.warn(random_result.log_msg)

demo-tests/test_single_xpass_xfail.py::test0_xfail
  /Users/jwr003/coding/pytest-tui/demo-tests/test_single_xpass_xfail.py:17: Warning: You ave been warned!
    warnings.warn(Warning("You ave been warned!"))

demo-tests/test_single_xpass_xfail.py::test0_xpass
  /Users/jwr003/coding/pytest-tui/demo-tests/test_single_xpass_xfail.py:29: Warning: You ave been warned!
    warnings.warn(Warning("You ave been warned!"))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:13: Warning: Happen agent machine now officer door.
  Home outside letter. Parent learn different speech. Win camera face Congress year other box.
    warnings.warn(Warning(fake_data(50, 200)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:14: UserWarning: Set price oil such. Building family opportunity occur sure over. Space piece area front which hope.
    warnings.warn(UserWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:15: DeprecationWarning: Condition tree open change evidence. Article this particularly record realize project.
    warnings.warn(DeprecationWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:16: SyntaxWarning: Arrive white how several.
    warnings.warn(SyntaxWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:17: RuntimeWarning: Just floor do beautiful product hotel produce. Follow policy popular back something. Full region hundred high look care up.
    warnings.warn(RuntimeWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:18: FutureWarning: Manager more interest. Simply especially music entire building. Scientist through laugh same range possible coach.
    warnings.warn(FutureWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:19: PendingDeprecationWarning: Involve strategy million same.
  Note avoid wide attention task ok whether. Election home should analysis.
    warnings.warn(PendingDeprecationWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:21: UnicodeWarning: Political no may senior college role. Never central century view think.
    warnings.warn(UnicodeWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:22: BytesWarning: Author firm maybe deal right charge try. Cultural Mrs after very six however significant green.
    warnings.warn(BytesWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_1_fails_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:24: UserWarning: Real huge show fact left. Force simple trip little able hear report.
  Economy seem trip push scene he down which. Price likely reflect system level end Democrat. Man item between.
    warnings.warn((fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:30: Warning: Owner support interesting cover around television. Deep here five their condition provide.
  Situation research argue town address case ball. Control decade ready.
    warnings.warn(Warning(fake_data(50, 200)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:31: UserWarning: Travel avoid red only model watch. Approach difference security few around agency. Relate simple responsibility seem site place chance.
    warnings.warn(UserWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:32: DeprecationWarning: Explain open however little. Character guy weight another stock.
    warnings.warn(DeprecationWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:33: SyntaxWarning: Teacher management that free recognize. Cell everyone material trade. Service side myself yet cultural wind.
    warnings.warn(SyntaxWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:34: RuntimeWarning: Attack thousand western according stuff person. During health may how hundred anyone. West move attack high begin exist own. Can shoulder factor job among player serious.
    warnings.warn(RuntimeWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:35: FutureWarning: Miss another lose something high. Religious exactly which simply deal light. Sell moment kid above six.
  Material really would visit. Partner me get nearly claim.
    warnings.warn(FutureWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:36: PendingDeprecationWarning: House special water right seven accept.
    warnings.warn(PendingDeprecationWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:38: UnicodeWarning: Dark go husband on agent maintain bank.
    warnings.warn(UnicodeWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:39: BytesWarning: Care anything social ok. Try real individual wife against huge. Kitchen adult better manager long matter pretty.
    warnings.warn(BytesWarning(fake_data(55, 205)))

demo-tests/test_warnings.py::test_2_passes_with_warnings
  /Users/jwr003/coding/pytest-tui/demo-tests/test_warnings.py:41: UserWarning: Strong miss company. Response him enter black eye economic.
  Word such western full. Black home fund despite finish chance clearly because.
    warnings.warn((fake_data(55, 205)))

testing/python/test_pytest_tui.py::test_true_assertion
testing/python/test_pytest_tui.py::test_false_assertion
  /Users/jwr003/coding/pytest-tui/venv/lib/python3.9/site-packages/pytest_metadata/plugin.py:123: PytestDeprecationWarning: The hookimpl pytest_testnodedown uses old-style configuration options (marks or attributes).
  Please use the pytest.hookimpl(optionalhook=True) decorator instead
   to configure the hooks.
   See https://docs.pytest.org/en/latest/deprecations.html#configuring-hook-specs-impls-using-markers
    @pytest.mark.optionalhook

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html

.
.
.
.

---------------------------------------------------------------------------------- generated Markdown report: /Users/jwr003/coding/pytest-tui/report.md ----------------------------------------------------------------------------------

======================================================================================================== rerun test summary info =========================================================================================================
RERUN demo-tests/test_rerun_fixed.py::test_flaky_1
RERUN demo-tests/test_rerun_fixed.py::test_flaky_1
RERUN demo-tests/test_rerun_fixed.py::test_flaky_2
RERUN demo-tests/test_rerun_fixed.py::test_flaky_2
RERUN demo-tests/test_rerun_random.py::test_flaky_1
RERUN demo-tests/test_rerun_random.py::test_flaky_2
RERUN demo-tests/test_rerun_random.py::test_flaky_3
RERUN demo-tests/test_rerun_random.py::test_flaky_3
RERUN demo-tests/test_rerun_random.py::test_flaky_always_fail
RERUN demo-tests/test_rerun_random.py::test_flaky_always_fail
======================================================================================================== short test summary info =========================================================================================================
PASSED demo-tests/test_0.py::test0_pass_1
PASSED demo-tests/test_0.py::test0_pass_2_logs
PASSED demo-tests/test_0.py::test0_skip
PASSED demo-tests/test_0.py::test0_warning
PASSED demo-tests/test_0.py::test_flaky_3
PASSED demo-tests/test_1.py::test_a_ok
PASSED demo-tests/test_1.py::test_d2_skip
PASSED demo-tests/test_1.py::test_g_eval_parameterized[3+5-8]
PASSED demo-tests/test_1.py::test_g_eval_parameterized[2+4-6]
PASSED demo-tests/test_1.py::test_1_passes_and_has_logging_output
PASSED demo-tests/test_1.py::test_4_passes
PASSED demo-tests/test_1.py::test_13_passes_and_has_stdout
PASSED demo-tests/test_2.py::test_a_ok
PASSED demo-tests/test_2.py::test_d2_skip
PASSED demo-tests/test_2.py::test_e1
PASSED demo-tests/test_2.py::test_f1
PASSED demo-tests/test_issue_1004.py::test_foo
PASSED demo-tests/test_random_results.py::test_0
PASSED demo-tests/test_random_results.py::test_2
PASSED demo-tests/test_random_results.py::test_4
PASSED demo-tests/test_random_results.py::test_5
PASSED demo-tests/test_random_results.py::test_6
PASSED demo-tests/test_random_results.py::test_7
PASSED demo-tests/test_random_results.py::test_8
PASSED demo-tests/test_random_results.py::test_9
PASSED demo-tests/test_random_results.py::test_10
PASSED demo-tests/test_rerun_random.py::test_flaky_0
PASSED demo-tests/test_rerun_random.py::test_flaky_2
PASSED demo-tests/test_rerun_random.py::test_flaky_3
PASSED demo-tests/test_rerun_random.py::test_flaky_always_pass
PASSED demo-tests/test_warnings.py::test_2_passes_with_warnings
PASSED testing/python/test_pytest_tui.py::test_true_assertion
PASSED testing/python/test_pytest_tui.py::test_false_assertion
SKIPPED [1] demo-tests/test_1.py:67: Skipping this test with inline call to 'pytest.skip()'.
SKIPPED [1] demo-tests/test_1.py:87: Skipping this test with inline call to 'pytest.skip()'.
SKIPPED [1] demo-tests/test_1.py:187: unconditional skip
SKIPPED [1] demo-tests/test_2.py:69: Skipping this test with inline call to 'pytest.skip()'.
SKIPPED [1] demo-tests/test_2.py:89: Skipping this test with inline call to 'pytest.skip()'.
XFAIL demo-tests/test_0.py::test0_xfail
XFAIL demo-tests/test_1.py::test_e1_xfail_by_inline_and_has_reason - reason: Marked as Xfail with inline call to 'pytest.xfail()'.
XFAIL demo-tests/test_1.py::test_e2_xfail_by_decorator_and_has_reason - reason: Marked as Xfail with decorator.
XFAIL demo-tests/test_1.py::test_f1_xfails_by_inline_even_though_assertTrue_happens_before_pytestDotXfail - reason: Marked as Xfail with inline call to 'pytest.xfail()'.
XFAIL demo-tests/test_1.py::test_7_marked_xfail_by_decorator_and_fails_and_has_no_reason
XFAIL demo-tests/test_random_results.py::test_3 - reason: Rerun: Serious inside else memory if six.
XFAIL demo-tests/test_single_xpass_xfail.py::test0_xfail
XFAIL demo-tests/test_xpass_xfail.py::test_xfail_by_inline - reason: xfailing this test with 'pytest.xfail()'
XFAIL demo-tests/test_xpass_xfail.py::test_xfail_by_decorator - Here's my reason for xfail: None
XPASS demo-tests/test_0.py::test0_xpass 
XPASS demo-tests/test_1.py::test_f2_xpass_by_xfail_decorator_and_has_reason Marked as Xfail with decorator.
XPASS demo-tests/test_1.py::test_6_marked_xfail_by_decorator_but_passes_and_has_no_reason 
XPASS demo-tests/test_2.py::test_e2 Marked as Xfail with decorator.
XPASS demo-tests/test_single_xpass_xfail.py::test0_xpass 
ERROR demo-tests/test_0.py::test0_pass_3_error_in_fixture - Exception: Error in fixture
ERROR demo-tests/test_1.py::test_c_error - assert 0
ERROR demo-tests/test_1.py::test_14_causes_error_pass_stderr_stdout_stdlog
ERROR demo-tests/test_1.py::test_15_causes_error_fail_stderr_stdout_stdlog
ERROR demo-tests/test_2.py::test_c_error - assert 0
ERROR demo-tests/test_hoefling.py::test_3 - RuntimeError: setup error
FAILED demo-tests/test_0.py::test0_fail_1 - assert 1 == 2
FAILED demo-tests/test_1.py::test_b_fail - assert 0
FAILED demo-tests/test_1.py::test_g_eval_parameterized[6*9-42] - AssertionError: assert 54 == 42
FAILED demo-tests/test_1.py::test_2_fails_and_has_logging_output - assert 0 == 1
FAILED demo-tests/test_1.py::test_3_fails - assert 0
FAILED demo-tests/test_1.py::test_8_causes_a_warning - TypeError: api_v1() missing 1 required positional argument: 'log_testname'
FAILED demo-tests/test_1.py::test_9_lorem_fails - assert False
FAILED demo-tests/test_1.py::test_10_fail_capturing - assert False
FAILED demo-tests/test_1.py::test_10b_failed_capturing - assert False
FAILED demo-tests/test_1.py::test_11_pass_capturing - TypeError: disabled() takes 1 positional argument but 2 were given
FAILED demo-tests/test_1.py::test_12_fails_and_has_stdout - assert 0 == 1
FAILED demo-tests/test_1.py::test_16_fail_compare_dicts_for_pytest_icdiff - AssertionError: assert ['Hello', 'hi... 'at', 'this'] == [7, 10, 45, 23, 18, 77]
FAILED demo-tests/test_2.py::test_b_fail - assert 0
FAILED demo-tests/test_hoefling.py::test_1 - assert False
FAILED demo-tests/test_hoefling.py::test_2 - RuntimeError: call error
FAILED demo-tests/test_issue_1004.py::test_foo2 - assert False
FAILED demo-tests/test_random_results.py::test_1 - assert False
FAILED demo-tests/test_rerun_fixed.py::test_flaky_1 - assert False
FAILED demo-tests/test_rerun_fixed.py::test_flaky_2 - assert False
FAILED demo-tests/test_rerun_random.py::test_flaky_1 - assert False
FAILED demo-tests/test_rerun_random.py::test_flaky_always_fail - assert False
FAILED demo-tests/test_warnings.py::test_1_fails_with_warnings - assert False
==================================================================== 22 failed, 33 passed, 5 skipped, 9 xfailed, 5 xpassed, 27 warnings, 6 errors, 10 rerun in 43.89s ====================================================================
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant