NYPL-Simplified / server_core

Shared data model and utilities for Library Simplified server applications
7 stars 11 forks source link

Simply-4025 Convert tests to Pytest #1278

Closed keithbauer closed 2 years ago

keithbauer commented 2 years ago

Description

Convert tests to use pytest fixtures.

Motivation and Context

SIMPLY-4025 SIMPLY-4024

How Has This Been Tested?

Checklist:

nballenger commented 2 years ago

One more argument for using test classes. Pytest fixtures all have a specific scope that determines how often they get set up and torn down. The scope can be one of:

If we don't have test classes we're leaving out an entire scope type, so we have fewer hooks for controlling how frequently fixture objects get instantiated. When we're looking for ways to speed up tests, I suspect finding cases where we can expand fixture scope is going to grant some easy wins.

keithbauer commented 2 years ago

I've implemented most of the feedback and added an action item comment to SIMPLY-4025 for the rest.