Docs
This commit is contained in:
parent
e867798f1a
commit
be27caa26c
1
AUTHORS
1
AUTHORS
|
@ -309,6 +309,7 @@ Pavel Karateev
|
|||
Paweł Adamczak
|
||||
Pedro Algarvio
|
||||
Petter Strandmark
|
||||
Philipp A.
|
||||
Philipp Loose
|
||||
Pierre Sassoulas
|
||||
Pieter Mulder
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
Fix some instances of importing doctests’ parent modules when using `--import-mode=importlib`.
|
|
@ -173,6 +173,9 @@ ignore = [
|
|||
[tool.ruff.format]
|
||||
docstring-code-format = true
|
||||
|
||||
[tool.ruff.lint]
|
||||
allowed-confusables = ["’", "×"]
|
||||
|
||||
[tool.ruff.lint.pycodestyle]
|
||||
# In order to be able to format for 88 char in ruff format
|
||||
max-line-length = 120
|
||||
|
|
|
@ -617,7 +617,7 @@ def module_name_from_path(path: Path, root: Path) -> str:
|
|||
_module_name_from_path(path, dir)
|
||||
for dir in itertools.chain([root], map(Path, sys.path))
|
||||
)
|
||||
return ".".join(min(candidates, key=len))
|
||||
return ".".join(min(candidates, key=len)) # type: ignore[arg-type]
|
||||
|
||||
|
||||
def _module_name_from_path(path: Path, root: Path) -> tuple[str, ...]:
|
||||
|
|
|
@ -691,6 +691,7 @@ class TestImportLibMode:
|
|||
init = pkgdir / "__init__.py"
|
||||
init.write_text("", encoding="ascii")
|
||||
|
||||
# the PyTest root is `proj_dir`, but the package is imported from `pkgs_dir`
|
||||
mod = import_path(init, root=proj_dir, mode=ImportMode.importlib)
|
||||
# assert that it’s imported with the canonical name, not “path.to.package.<name>”
|
||||
mod_names = [n for n, m in sys.modules.items() if m is mod]
|
||||
|
|
Loading…
Reference in New Issue