Skip to content

Commit

Permalink
Add typings to tests
Browse files Browse the repository at this point in the history
  • Loading branch information
yalef committed Nov 22, 2023
1 parent 2e36b52 commit 82e75b4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
6 changes: 3 additions & 3 deletions tests/conftest.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ def membership(band: Band) -> Membership:


@pytest.fixture
def uploaded_file(existing_artist: Artist):
def uploaded_file(existing_artist: Artist) -> SimpleUploadedFile:
"""Generate valid `Artist` import file."""
import_job = ArtistImportJobFactory.build(artists=[existing_artist])
return SimpleUploadedFile(
Expand All @@ -72,7 +72,7 @@ def uploaded_file(existing_artist: Artist):


@pytest.fixture
def force_import_artist_job(new_artist: Artist):
def force_import_artist_job(new_artist: Artist) -> Artist:
"""Return `ImportJob` with `force_import=True` and file with invalid row."""
return ArtistImportJobFactory(
artists=[new_artist],
Expand All @@ -82,7 +82,7 @@ def force_import_artist_job(new_artist: Artist):


@pytest.fixture
def invalid_uploaded_file(new_artist: Artist):
def invalid_uploaded_file(new_artist: Artist) -> SimpleUploadedFile:
"""Generate invalid `Artist` imort file."""
import_job = ArtistImportJobFactory.build(
artists=[new_artist],
Expand Down
2 changes: 2 additions & 0 deletions tests/fake_app/factories.py
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,8 @@ def data_file(self):
resource = SimpleArtistResource()

if self.is_invalid_file:
# Append not existing artist with a non-existent instrument
# to violate the not-null constraint
self.artists.append(
ArtistFactory.build(instrument=InstrumentFactory.build()),
)
Expand Down

0 comments on commit 82e75b4

Please sign in to comment.