pytest-djangoapp icon indicating copy to clipboard operation
pytest-djangoapp copied to clipboard

WIP: urlpattarns fixtures

Open jayvdb opened this issue 4 years ago • 2 comments

Based on top of https://github.com/idlesign/pytest-djangoapp/pull/17

jayvdb avatar Jul 29 '20 04:07 jayvdb

Pull Request Test Coverage Report for Build 88

  • 42 of 48 (87.5%) changed or added relevant lines in 4 files are covered.
  • 17 unchanged lines in 5 files lost coverage.
  • Overall coverage decreased (-4.0%) to 94.553%

Changes Missing Coverage Covered Lines Changed/Added Lines %
pytest_djangoapp/fixtures/urls.py 26 32 81.25%
<!-- Total: 42 48
Files with Coverage Reduction New Missed Lines %
pytest_djangoapp/compat.py 2 66.67%
pytest_djangoapp/fixtures/request.py 2 88.33%
pytest_djangoapp/fixtures/utils.py 2 83.33%
pytest_djangoapp/fixtures/templates.py 3 90.48%
pytest_djangoapp/configuration.py 8 89.71%
<!-- Total: 17
Totals Coverage Status
Change from base Build 86: -4.0%
Covered Lines: 486
Relevant Lines: 514

💛 - Coveralls

coveralls avatar Jul 29 '20 04:07 coveralls

The fixtures are currently session scope - I think testapp could be session-auto to be backwards compatible.

However the fixtures need enhancement to be non-session fixtures, so that they work more like the settings fixture, dropping routes added during the test.

I initially built this as part of https://github.com/jayvdb/drf-problems/tree/add-tests , and ran into several issues within pytest-djangoapp that need polishing before this urlpatterns fixture can be built nicely.

jayvdb avatar Jul 29 '20 04:07 jayvdb