Comments (4)
I answer to myself. Instead of importing the decorator from nose we can use a pattern like this one:
import unittest
class SomeTestBase(unittest.TestCase):
def test_number_one(self):
self.assertRaises(MyExceptionThatShouldBeRaised, mycallable, myarg1, myarg2, mykw1='1')
from green.
Wow, self-answering questions! ;-) Yes, you're absolutely right.
The way you were doing it in nose is really similar to what's being requested in issue #13. Did you want to request this functionality as a feature, or are you satisfied with the workaround?
from green.
Well actually I think I'll stick with the unittest way since it is more explicit and will catch the exception only on the line you expect it to raise and will avoid "false positives"
from green.
That's a good point.
from green.
Related Issues (20)
- Python 3.9.6 threading compatibility HOT 14
- django.db.utils.ProgrammingError: relation "users_user" does not exist HOT 3
- Combine methode name and doc string in output HOT 2
- Question: What is a "test" in context of --processes HOT 1
- SyntaxError not catched when named explicte but unittest does HOT 4
- Confusing error when I have errors in source code HOT 4
- Problem with -r (coverage) output HOT 1
- Missing git tag for 3.4.2 release HOT 1
- green might hang on async tests HOT 3
- shutil cleanup sometimes fails on python 3.8 HOT 5
- running green -vvv green.test.test_runner on PyPy + macOS errors out HOT 2
- Feature request: option to debug tests
- Python 3.12 support HOT 4
- Join The Project Team HOT 7
- stopTest issue with Python 3.12.1 and skipped tests HOT 15
- Move Release Process to GitHub Actions HOT 7
- Please add me to the project as a maintainer HOT 2
- Fix lack of coverage in CI HOT 3
- Change default branch on coveralls to "main" HOT 2
- Upload wheels to pypi 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 green.