Code Monkey home page Code Monkey logo

Comments (13)

jeffwright13 avatar jeffwright13 commented on May 26, 2024

Those look like two totally different results to me, and it's not clear if they should both be colored the same or not. Can you provide the test that resulted in this? Or reproduce with a different test? I can provide you with sample tests that give all the different outcomes if you like.

from pytest-check.

ant1kdream avatar ant1kdream commented on May 26, 2024

@jeffwright13 Yes, sure. It's easily reproducing. Below comparing outputs from classic assert, pytest-assume and pytest-check and all results exported to pytest-html with next args:

--html=report.html --self-contained-html

from pytest_assume.plugin import assume
from pytest_check import check


def test_assert():
    assert 2 < 1, 'some message'

def test_assume():
    with assume: assert 2 < 1, 'some message'

def test_check():
    with check: assert 2 < 1, 'some message'

in html we see that classic assert and pytest-assume have classic red color in AssertionError message, except of pytest-check
image

from pytest-check.

jeffwright13 avatar jeffwright13 commented on May 26, 2024

Oh, I see what you are saying now. I didn't pick up on the fact that you're using different plugins, each of which changes the output in some way.

I'm sure @okken is more than capable of figuring out the issue, so I will just watch from the sidelines. I'd take a stab at it myself, but it does take time to assimilate someone else's code, and I'm not super familiar with this plugin.

from pytest-check.

okken avatar okken commented on May 26, 2024

I'm open to consider PRs for the change.

from pytest-check.

okken avatar okken commented on May 26, 2024

This is a good idea.
working on a solution.

from pytest-check.

okken avatar okken commented on May 26, 2024

color added in #94

from pytest-check.

okken avatar okken commented on May 26, 2024

I haven't checked the html output

from pytest-check.

okken avatar okken commented on May 26, 2024

My changes don't help any with the html output from pytest-html.

from pytest-check.

okken avatar okken commented on May 26, 2024

I actually think I made things worse for pytest-html.
So if using pytest-html, I recommend --color=no until we get this sorted out.

from pytest-check.

jeffwright13 avatar jeffwright13 commented on May 26, 2024

This makes me curious about how my plugin will handle this situation. I'll give it a test.

from pytest-check.

okken avatar okken commented on May 26, 2024

probably pushing to main today

from pytest-check.

okken avatar okken commented on May 26, 2024

This would require digging into pytest-html, maybe, which I'm not interested in doing at this time.

from pytest-check.

okken avatar okken commented on May 26, 2024

Closing for now. Feel free to bring up the issue again if you've got any thoughts on how to implement it.

from pytest-check.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.