mirror of
https://github.com/gentoo-mirror/gentoo.git
synced 2025-12-15 00:10:53 +03:00
53 lines
1.6 KiB
Diff
53 lines
1.6 KiB
Diff
From da6818492f66cb0512a2de69f1fdb15de0d07ed2 Mon Sep 17 00:00:00 2001
|
|
From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
|
|
Date: Sat, 13 Sep 2025 07:51:46 +0200
|
|
Subject: [PATCH] Use a more unique name for fake module doctests
|
|
MIME-Version: 1.0
|
|
Content-Type: text/plain; charset=UTF-8
|
|
Content-Transfer-Encoding: 8bit
|
|
|
|
Change the tested "fake" module name from `fake` to `__fake__` to reduce
|
|
the risk of collisions with real modules. This fixes test failures
|
|
when the package is tested in a system environment where `fake.py`
|
|
package is installed.
|
|
|
|
Signed-off-by: Michał Górny <mgorny@gentoo.org>
|
|
---
|
|
src/zope/testing/module.txt | 10 +++++-----
|
|
1 file changed, 5 insertions(+), 5 deletions(-)
|
|
|
|
diff --git a/src/zope/testing/module.txt b/src/zope/testing/module.txt
|
|
index 6134ca2..555b526 100644
|
|
--- a/src/zope/testing/module.txt
|
|
+++ b/src/zope/testing/module.txt
|
|
@@ -68,13 +68,13 @@ Importing
|
|
Let's now imagine a more complicated example, were we actually want to
|
|
be able to import the fake module as well:
|
|
|
|
- >>> setUp(test, 'fake')
|
|
+ >>> setUp(test, '__fake__')
|
|
>>> a = 'Hello world'
|
|
|
|
The import should not fail:
|
|
|
|
- >>> import fake
|
|
- >>> fake.a
|
|
+ >>> import __fake__
|
|
+ >>> __fake__.a
|
|
'Hello world'
|
|
|
|
Let's tear it down again:
|
|
@@ -87,10 +87,10 @@ Let's tear it down again:
|
|
.. doctest::
|
|
:pyversion: < 3
|
|
|
|
- >>> import fake
|
|
+ >>> import __fake__
|
|
Traceback (most recent call last):
|
|
...
|
|
- ModuleNotFoundError: No module named 'fake'
|
|
+ ModuleNotFoundError: No module named '__fake__'
|
|
|
|
If we enter a dotted name, it will actually try to place the fake
|
|
module in that dotted name:
|