question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Overhaul unittest and fixtures

See original GitHub issue

Remove 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 to TestThing
  • 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:closed
  • Created 6 years ago
  • Comments:11 (11 by maintainers)

github_iconTop GitHub Comments

1reaction
rebeccabilbrocommented, May 1, 2019

Gotcha @bbengfort, I’ll add to the v1.0 milestone in that case.

0reactions
ndanielsencommented, Jun 29, 2019

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found