Giter Club home page Giter Club logo

Comments (5)

petereon avatar petereon commented on August 20, 2024

All, 1., 2. and 4. sound great, I have nothing to add there.
On 3rd point I have just few clarifying questions:

  • to_have_attributes() is going to take a list of names of expected attributes as arguments?
  • What is to_almost_equal() meaning to match? Numeric similarity with some sort of acceptable delta?

Your changes are very welcome!

from expycted.

bdsoha avatar bdsoha commented on August 20, 2024

Regarding to_have_attributes, I imaging the following overloaded signatures:

def to_have_attribute(self, key: str):
    ...

def to_have_attribute(self, key: str, value: Any):
    ...

def to_have_attributes(self, *keys: str):
    ...

An explanation of to_almost_equal from the Python's built-in unittest package.

from expycted.

petereon avatar petereon commented on August 20, 2024

Both sound great! Looking forward to the PR(s)!

from expycted.

bdsoha avatar bdsoha commented on August 20, 2024

@petereon Before I get started, one more question, is there a reason why you split alias and negated test into separate methods?

Example:

  • test_to_contain_subfolder
  • test_to_contain_subfolder_failing
  • test_to_not_contain_subfolder
  • test_to_not_contain_subfolder_failing

from expycted.

petereon avatar petereon commented on August 20, 2024

@bdsoha Yes, it's for legacy reasons, there have previously been separate implementations for negated matchers. Aliases don't necessarily make sense, I agree. As it is it would presumably make more sense to test just the __init__ method that it negates correctly.

from expycted.

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.