Skip to content

Commit 4deab03

Browse files
committed
Some renamings
1 parent a7460c4 commit 4deab03

14 files changed

+26
-19
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
include README.rst COPYING setup.py MANIFEST.in CHANGELOG.md ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0.tar.gz ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl
1+
include README.rst COPYING setup.py MANIFEST.in CHANGELOG.md ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0-py3-none-any.whl ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0.tar.gz
22
recursive-include rope *.py
33
recursive-include docs *.rst
44
recursive-include ropetest *.py
Binary file not shown.

ropetest-package-fixtures/example-external-package/pyproject.toml ropetest-package-fixtures/external_fixturepkg/pyproject.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ requires = ["flit-core >= 3.8"]
33
build-backend = "flit_core.buildapi"
44

55
[project]
6-
name = "example_external_package"
6+
name = "external_fixturepkg"
77
version = "1.0.0"
88
description = "Just an example project built with build/flit for testing purpose"
99
readme = "README.md"

ropetest/conftest.py

+10-3
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,14 @@ def mod2(project, pkg1) -> resources.Folder:
5050

5151

5252
@pytest.fixture(scope="session")
53-
def example_external_package():
54-
check_call([sys.executable, "-m", "pip", "install", "--force-reinstall", "ropetest-package-fixtures/example-external-package/dist/example_external_package-1.0.0-py3-none-any.whl"])
53+
def external_fixturepkg():
54+
check_call([
55+
sys.executable,
56+
"-m",
57+
"pip",
58+
"install",
59+
"--force-reinstall",
60+
"ropetest-package-fixtures/external_fixturepkg/dist/external_fixturepkg-1.0.0-py3-none-any.whl",
61+
])
5562
yield
56-
check_call([sys.executable, "-m", "pip", "uninstall", "--yes", "example-external-package"])
63+
check_call([sys.executable, "-m", "pip", "uninstall", "--yes", "external-fixturepkg"])

ropetest/contrib/autoimport/conftest.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -24,18 +24,18 @@ def typing_path():
2424

2525

2626
@pytest.fixture
27-
def example_external_package_module_path(example_external_package):
28-
from example_external_package import example_module
29-
yield pathlib.Path(example_module.__file__)
27+
def example_external_package_module_path(external_fixturepkg):
28+
from external_fixturepkg import mod1
29+
yield pathlib.Path(mod1.__file__)
3030

3131

3232
@pytest.fixture
33-
def example_external_package_path(example_external_package):
34-
import example_external_package
33+
def example_external_package_path(external_fixturepkg):
34+
import external_fixturepkg
3535

3636
# Uses __init__.py so we need the parent
3737

38-
yield pathlib.Path(example_external_package.__file__).parent
38+
yield pathlib.Path(external_fixturepkg.__file__).parent
3939

4040

4141
@pytest.fixture

ropetest/contrib/autoimport/utilstest.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def test_get_package_source_pytest(example_external_package_path):
1818
# pytest is not installed as part of the standard library
1919
# but should be installed into site_packages,
2020
# so it should return Source.SITE_PACKAGE
21-
source = utils.get_package_source(example_external_package_path, None, "example_module")
21+
source = utils.get_package_source(example_external_package_path, None, "mod1")
2222
assert source == Source.SITE_PACKAGE
2323

2424

@@ -42,7 +42,7 @@ def test_get_modname_folder(
4242
example_external_package_module_path,
4343
example_external_package_path,
4444
)
45-
assert modname == "example_external_package.example_module"
45+
assert modname == "external_fixturepkg.mod1"
4646

4747

4848
def test_get_package_tuple_sample(project_path):

ropetest/contrib/autoimporttest.py

+6-6
Original file line numberDiff line numberDiff line change
@@ -177,14 +177,14 @@ def test_skipping_directories_not_accessible_because_of_permission_error(self):
177177
self.assertGreater(len(self.importer._dump_all()), 0)
178178

179179

180-
def test_search_submodule(example_external_package):
180+
def test_search_submodule(external_fixturepkg):
181181
project = testutils.sample_project(extension_modules=["sys"])
182182
importer = autoimport.AutoImport(project, observe=False)
183-
importer.update_module("example_external_package")
184-
import_statement = ("from example_external_package import example_module", "example_module")
185-
assert import_statement in importer.search("example_module", exact_match=True)
186-
assert import_statement in importer.search("exam")
187-
assert import_statement in importer.search("example_module")
183+
importer.update_module("external_fixturepkg")
184+
import_statement = ("from external_fixturepkg import mod1", "mod1")
185+
assert import_statement in importer.search("mod1", exact_match=True)
186+
assert import_statement in importer.search("mo")
187+
assert import_statement in importer.search("mod1")
188188

189189

190190
class AutoImportObservingTest(unittest.TestCase):

0 commit comments

Comments
 (0)