Comments (22)
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.
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.
No. I forgot to add parenthesis to one print.
Fixing it.
from pyspecs.
It should already be fixed in master.
from pyspecs.
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.
It should be fixed too right now.
from pyspecs.
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.
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.
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.
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.
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.
I'm using this issue to fix this too so I suppose not. Let's fix this here too
from pyspecs.
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.
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.
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.
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.
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.
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.
Ok, I will add them for tomorrow.
They are here: https://github.com/mdwhatcott/pyspecs/blob/master/pyspecs/_should.py
from pyspecs.
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.
Agree) Thank you! I'm closing this one
from pyspecs.
btw i've used ipython 4.2. Need to upgrade mine
from pyspecs.
Related Issues (15)
- Integration with existing python test runners (unittest, nose etc) HOT 2
- Add Travis job. HOT 1
- Nose 2 compatibility HOT 7
- Incorrect example (maybe) HOT 4
- Example of how to handle an exception HOT 7
- pip install pyspecs fails HOT 2
- No UTF-8 characters in the output HOT 2
- License? HOT 1
- Need to flush stdout for darwin HOT 1
- More options for targeting files to load (import) and which test files to run HOT 1
- dot output as a less verbose option? HOT 2
- Live step name reporting HOT 1
- A small enhancement to the pyspecs syntax HOT 2
- Python 3 compatibility HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pyspecs.