Code Monkey home page Code Monkey logo

Comments (7)

kazk avatar kazk commented on June 18, 2024 2

@Blind4Basics pytest actually produces nice failure message from simple assertions.

Similar to power asserts from Groovy. So

x = 1
assert x == 2

Fails with something like

Assertion failed:
  assert x == 2
         |  |
         1  false

It can produce more useful output depending on the test case.

from runner.

kazk avatar kazk commented on June 18, 2024 1

Codewars can only support one test framework per language at the moment because of how the database is set up. So we won't be able to add another test framework until we do the rewrite which I'm planning to start working on after my vacation.

I personally don't like having to maintain custom frameworks when there're existing ones we can use (e.g., JS/Python/Ruby, etc.), so I'd like to deprecate them in the future for new contents. We still need to keep them for a while for existing contents though.

For Python, I like pytest too and if I remember correctly, it supports custom reporter so it should be possible to add.

from runner.

suic86 avatar suic86 commented on June 18, 2024

@kazk: Thanks for quick reply. I'll wait patiently. :) Also, I completely agree with your stance on custom frameworks. Enjoy your vacation and good luck with the rewrite.

from runner.

suic86 avatar suic86 commented on June 18, 2024

@kazk: I came back to this after some time. I guess there's been no progress on this and the single test framework per language limitation is still there. One possible option would be to emulate the existing framework with pytest (i.e. the current framework would be an alternative syntax for pytest. Is this a sensible idea according to you?

from runner.

kazk avatar kazk commented on June 18, 2024

No progress on Codewars part.

Have you looked into if pytest supports custom reporters?

One possible option would be to emulate the existing framework with pytest (i.e. the current framework would be an alternative syntax for pytest. Is this a sensible idea according to you?

I'll consider it if it's fully backwards compatible and also depending on the amount of effort required.

from runner.

Blind4Basics avatar Blind4Basics commented on June 18, 2024

@suic86 : but what is the feeback for the user in case a test fails? Seems to me you're comparing assert_equals with an equivalent of expect. Not a good idea, imo.

from runner.

kazk avatar kazk commented on June 18, 2024

For reporting pytest results, we should be able to make custom reporter similar to https://github.com/pchomik/pytest-spec

I haven't looked into if we can simulate Codewars test framework with pytest so please let me know if you have some proposals. I'd be surprised if it turns out possible because codewars_test has lots of quirks.

from runner.

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.