Skip to content

Commit

Permalink
fix: 3.8 doesn't have importlib.resources.files
Browse files Browse the repository at this point in the history
  • Loading branch information
tomli380576 committed Dec 4, 2024
1 parent 4f82a6b commit c00d6fe
Showing 1 changed file with 4 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@

try:
# new in python 3.9
from importlib import resources
from importlib.resources import files

def read_file_as_str(name: str):
resource_path = "parsers/tests/v4l2_compliance_data/{}.txt".format(
name
)
ref = resources.files("checkbox_support")
ref = files("checkbox_support")
file_ref = ref.joinpath(resource_path)
with file_ref.open("r") as f:
return f.read()
Expand Down Expand Up @@ -62,7 +62,8 @@ def test_unparsable(self, mock_run: MagicMock):
@patch("subprocess.run")
def test_unopenable_device(self, mock_run: MagicMock):
err_messages = [
# 16.04 18.04: found this message in VMs without camera pass through
# 16.04 18.04: found this message in VMs
# without camera USB pass through
"Failed to open device /dev/video0: No such file or directory"
# 20.04: found this msg in VMs without camera pass through
# 22.04, 24.04: found this message if we disable camera in BIOS
Expand Down

0 comments on commit c00d6fe

Please sign in to comment.