Giter VIP home page Giter VIP logo

Comments (22)

areshytko avatar areshytko commented on May 30, 2024 1

There's a HUGE disadvantage of not importing the, this, etc. Because I can't use autocompletion for the hints about possible expressions to chain - and it kills all the usability. Honestly. I'm the very new to pyspecs so i don't remember all of them by heart (and I shouldn't!). There must be possibility for autocompletion in IDE and ipython shell, otherwise it's not usable. Also the docs in README contains import statements. I liked the ideas behind the pyspecs a lot, please consider these remarks

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024 1

yeah it works. Thank you. Although because attributes are added dynamically interpreter/IDE can't suggest autocompletion options..
where can I (or other users) find the list of possible attributes of a "should/should_NOT" property?

  • be_greater_than,
  • equal,
  • etc.
    only in sources?

from pyspecs.

magmax avatar magmax commented on May 30, 2024

No. I forgot to add parenthesis to one print.

Fixing it.

from pyspecs.

magmax avatar magmax commented on May 30, 2024

It should already be fixed in master.

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024

thnx for the quick response. guess it should be in another issue but post it here: i've tried to build it via setup.py from master and got another error:

running build
running build_py
running build_scripts
error: file '/home/areshytko/repos/pyspecs/scripts/pyspecs_.py' does not exist

from pyspecs.

magmax avatar magmax commented on May 30, 2024

It should be fixed too right now.

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024

okay another portion:
In [2]: from pyspecs import given, when, then, the, finish
ImportError: cannot import name 'given'

import pyspecs works

but it contains nothing in it

from pyspecs.

magmax avatar magmax commented on May 30, 2024

hmmmm... I sent a PR with a POC that was finally merged. I will fix it in a couple of days, I hope

from pyspecs.

magmax avatar magmax commented on May 30, 2024

I was wrong; it wasn't yet.

I've fixed the new problem and improved the travis execution in order to run the examples in addition to tests. It is working right now: https://travis-ci.org/mdwhatcott/pyspecs

In addition, I've fixed some flake8 recomendations and added it to travis.

Please, notice that the new version does not require to import anything. Check the examples.

from pyspecs.

magmax avatar magmax commented on May 30, 2024

The vocabulary is:

  • given
  • provided
  • at
  • when
  • and_
  • then
  • so
  • therefore
  • however
  • as_well_as
  • the
  • it
  • this
  • that

So, despite I do not agree with you, because my IDE already completes, it is not a huge dictionary and to have a python import in the specs file is not very clear (specs usually should be written by non-developers), I think it is a good idea to have backwards compatibility and allow that option.

So I'm on it.

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024

Yeah, the vocabulary of initial expressions is not a problem the problem is in remembering further statements such as should_NOT, should.be_empty() etc. it's a nice thing - to be able to press a button and see what options you have. I agree with you. But my primary use case is to use it instead of ordinary unit tests in my daily development cycle. I'm not a zealot of BDD but do believe that they are a "better version" of unit tests. Anyway, thank you! Should we close this issue?

from pyspecs.

magmax avatar magmax commented on May 30, 2024

I'm using this issue to fix this too so I suppose not. Let's fix this here too

from pyspecs.

magmax avatar magmax commented on May 30, 2024

The fix I wrote improved the test isolation. But the cost was that I inject the pyspecs methods instead to use the global pyspecs method.

I'm afraid the only way I see to make it is to have a fake version of them.

Please, could you try by adding from pyspecs.dictionary import * instead the current import?

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024

got an error:

In [1]: from pyspecs.dictionary import *

In [2]: this([1, 2, 3]).should.contain(2)

TypeError Traceback (most recent call last)
in ()
----> 1 this([1, 2, 3]).should.contain(2)

TypeError: 'object' object is not callable

from pyspecs.

magmax avatar magmax commented on May 30, 2024

OK. I see. You are trying to run it directly from your IDE, running the .spec file directly. Remember they are fake versions. I'm not sure if this has been a good idea.

The correct way to run them is with pyspecs directory

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024

okay, my fault. I thought it can be used like Expect or Should libraries are used in javascript BDD frameworks. what is pyscpecs directory and how to run with it?

from pyspecs.

magmax avatar magmax commented on May 30, 2024

In javascript they have very bad isolation.

Maybe I should go back and remove my changes.

Please, give me a couple of days to think about this.

from pyspecs.

magmax avatar magmax commented on May 30, 2024

I am not very fan from Singletons, but here it fits the bill.

It should be fixed, and the import is optional.

Additionally, I found a minor problem with reporting, because steps were not counted correctly.

from pyspecs.

magmax avatar magmax commented on May 30, 2024

Ok, I will add them for tomorrow.

They are here: https://github.com/mdwhatcott/pyspecs/blob/master/pyspecs/_should.py

from pyspecs.

magmax avatar magmax commented on May 30, 2024

I've been having a look to the list of attributes of a should/should_not properties. That properties just return the same element, so they just initialize the matcher.

I'm not sure about how your IDE works; maybe it doesn't process properties (ipython 5.1.0 does).

Anyway, this is far far beyond the scope of this issue, what was about installing pyspecs on python3 :)

Regards.

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024

Agree) Thank you! I'm closing this one

from pyspecs.

areshytko avatar areshytko commented on May 30, 2024

btw i've used ipython 4.2. Need to upgrade mine

from pyspecs.

Related Issues (15)

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.