Skip to content

Commit

Permalink
tests/datafiles: replace pkg_resources with importlib.resources
Browse files Browse the repository at this point in the history
  • Loading branch information
orbeckst committed Jun 17, 2024
1 parent a00ee59 commit 0c4bafc
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions tests/datafiles.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,14 @@
"""


import sys
import os.path
from pkg_resources import resource_filename
from importlib import resources


def datafile(name):
return resource_filename(__name__, os.path.join("data", name))
return (
resources.files(sys.modules[__name__].__package__)
.joinpath("data")
.joinpath(name)
)

0 comments on commit 0c4bafc

Please sign in to comment.