Comments (5)
Although this is more of a personal thing, and I'm not advocating for any specific testing tool, I suggest using pytest. One benefit of it is that it has really good assert rewriting which makes it possible to write tests such as:
variable = function()
assert variable == 1
And still get good feedback from the unit testing system rather than a plain AssertionError
. Furthermore, py.test
has a really good fixtures system that enables you to write really clean code, without having to do any test-case inheritance unless your needs are a little special. You can also use both functions and classes in your code:
class TestFunction:
def test_one_is_given(self):
assert f(1) == 2
def test_function():
assert f(1) == 2
Lastly it seems that more projects are using pytest compared to nose, so chances are that more developers are more familiar with pytest which means more people would be comfortable with contributing to the code.
from mosql.
I remember nose can do all the things you mentioned. Cloud you provide more references about pytest is better than nose?
from mosql.
http://halfcooked.com/presentations/pyconau2013/why_I_use_pytest.html
from mosql.
I’ll admit that documentation on Nose is sparse (putting it mildly) compared to pytest. I can’t say too much about Unicode tracebacks, but since Python 2 is terrible at this in general I’d say using non-ASCII characters in tracebacks is not a good idea in most cases.
The thing is, there are already tests written with Nose, and somebody needs to convert them to pytest test cases if we’re to make the switch. This includes all tests inside the tests
directory (no many), and a nose plugin that runs Sphinx doctests inside Nose. AFAIK no such plugin on pytest exists, so somebody will need to implement that as well. I like pytest, but it might not be the right tool right now as this project currently stands.
BTW is this issue really necessary now? IIRC all failed doctests have already been converted to nose tests, and other doctests work fine as-is.
from mosql.
@uranusjr yeah, I just forgot close this issue actually.
@eugene-eeo I don't see enough improvement if we switch to pytest. But still thanks for you introduced pytest to us. :)
I will close this issue.
from mosql.
Related Issues (20)
- Port MoSQL to Python 3 HOT 1
- Fix the wrong doc caused by monkey patch HOT 1
- The print statements cause the fails in doctest in Python 3 HOT 3
- The test of SQLite should be split into doctest and example HOT 1
- 支援一些特殊語法 HOT 4
- help not really help for insert, delete, select ,, etc. HOT 12
- Add doc for subquery and the `AS` feature. HOT 1
- AS does not work in JOIN HOT 1
- "Unloading" MySQL fixes HOT 1
- Multi-row INSERT HOT 6
- mosql.sqlite leaks docs
- mosql.func leaks docs HOT 1
- benchmark script HOT 1
- Coercing values during chaining HOT 1
- BigQuery support HOT 1
- 0.9.1 does not work on Python 3 HOT 1
- SQLite patch should stringify True and False to 1 and 0
- Expand ConnContext and make it as a new feature HOT 1
- Subquery support and `raw` objects HOT 4
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 mosql.