FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

bpo-42129: Add support for resources in namespaces by jaraco · Pull Request #24670 · python/cpython · GitHub

Repository navigation

Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension .py  (2) All 1 file type selected
Viewed files
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Unified
Split
Hide whitespace
Diff view
Unified
Split
Hide whitespace
Prev Previous commit
Apply changes from importlib_resources 5.0.4
  • Loading branch information
jaraco committed Mar 4, 2021
commit a7555f6d290d4541325a66246e0990a79a5d286f
12 changes: 10 additions & 2 deletions Lib/test/test_importlib/test_reader.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import os.path
import sys
import pathlib
import unittest

from importlib import import_module
Expand All @@ -9,7 +10,8 @@
class MultiplexedPathTest(unittest.TestCase):
@classmethod
def setUpClass(cls):
cls.folder = os.path.abspath(os.path.join(__file__, '..', 'namespacedata01'))
path = pathlib.Path(__file__).parent / 'namespacedata01'
cls.folder = str(path)

def test_init_no_paths(self):
with self.assertRaises(FileNotFoundError):
Expand Down Expand Up @@ -83,9 +85,15 @@ def test_repr(self):


class NamespaceReaderTest(unittest.TestCase):
site_dir = str(pathlib.Path(__file__).parent)

@classmethod
def setUpClass(cls):
sys.path.append(os.path.abspath(os.path.join(__file__, '..')))
sys.path.append(cls.site_dir)

@classmethod
def tearDownClass(cls):
sys.path.remove(cls.site_dir)

def test_init_error(self):
with self.assertRaises(ValueError):
Expand Down
9 changes: 7 additions & 2 deletions Lib/test/test_importlib/test_resource.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import os.path
import sys
import unittest
import uuid
Expand Down Expand Up @@ -216,9 +215,15 @@ def test_read_text_does_not_keep_open(self):


class ResourceFromNamespaceTest01(unittest.TestCase):
site_dir = str(pathlib.Path(__file__).parent)

@classmethod
def setUpClass(cls):
sys.path.append(os.path.abspath(os.path.join(__file__, '..')))
sys.path.append(cls.site_dir)

@classmethod
def tearDownClass(cls):
sys.path.remove(cls.site_dir)

def test_is_submodule_resource(self):
self.assertTrue(
Expand Down

Back | FazBrowse Home | New Git URL