Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions test/BUILD
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,14 @@ python_test(
],
)

python_test(
name = "resources_test",
srcs = ["resources_test.py"],
deps = [
"//third_party/python:pygments",
],
)

python_test(
name = "interpreter_not_included_test",
srcs = ["interpreter_not_included_test.py"],
Expand Down
12 changes: 12 additions & 0 deletions test/resources_test.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import importlib.resources
import unittest


class ResourcesTest(unittest.TestCase):
"""Tests that PexDistribution is able to provide access to files that are part of a distribution
via the importlib.resources API.
"""

def test_read_resource_text_file(self):
init = importlib.resources.files("pygments") / "__init__.py"
self.assertIn("__version__ = '2.19.2'", init.read_text())