Overhaul unittest and fixtures
See original GitHub issueRemove dependency on unittest.TestCase
by replacing assertions with assert
statements. This also involves using pytest.raises
and pytest.skip
decorators.
Use PyTest fixtures for datasets and other fixtures.
~Add PEP checking to pytest (alongside pyflakes)~
- rename
ThingTests
toTestThing
- assertions
- pytest.skip
- dataset fixtures
- ~PEP8~
Alongside this we should also do a PY2 removal check, namely anywhere:
try:
from unittest import mock
except ImportError:
import mock
should be replaced with just from unittest import mock
Issue Analytics
- State:
- Created 6 years ago
- Comments:11 (11 by maintainers)
Top Results From Across the Web
pytest fixtures: explicit, modular, scalable
Software test fixtures initialize test functions. They provide a fixed baseline so that tests execute reliably and produce consistent, repeatable, results.
Read more >How to use pytest fixtures with Unittest methods - Stack Overflow
If I use @pytest.fixture(autouse=True) I end up with some strange behavior from PyTest. Instead of calling my setUp method before the test ...
Read more >Mixing Pytest Fixture and unittest.TestCase for Selenium Test
Solution: Write a driver class in conftest.py In the conftest.py , we have to write each option as a pytest. fixture function. And...
Read more >Why Unit Testing Matters (We Even Developed a ... - Integrant
Defects revealed by a unit test are easy to locate and relatively easy to repair. There are no shortcuts to successful software development....
Read more >Implementing setUp,tearDown,setUpclass ... - YouTube
... 3 years ago Testing Python, Django and Django Rest Framework Applications by using unittest, pytest and Selenium Frameworks by Durga Sir.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Gotcha @bbengfort, I’ll add to the v1.0 milestone in that case.
Recommend that we remove PEP8 from this as we are going to add Black in another V1.0 issue: https://github.com/DistrictDataLabs/yellowbrick/issues/456